This article mainly introduces the CSS3 UI element State pseudo-class selector, including hover, active and focus,enabled,disabledread-only and Read-write, and so on, the need for friends can refer to the following
The so-called UI selector: The specified style works only when the element is in a certain state and does not work in the default state!
Browser compatibility:
E:hover supports Firefox, Safari, Opera, IE8, Chrome------------
e:active support for Firefox, Safari, Opera, Chrome does not support IE8
E: Focus supports Firefox, Safari, Opera, IE8, Chrome-------------
e:enabled support for Firefox, Safari, Opera, Chrome does not support IE8
E: Disabled support for Firefox, Safari, Opera, Chrome does not support IE8
E:read-only support Firefox, Opera does not support IE8, Safari, Chrome
E:read-write Support for Firefox, Opera does not support IE8, Safari, Chrome
e:checked support Firefox, Safari, Opera, Chrome does not support IE8
E::selection support Firefox, Safari, Opera, Chrome does not support IE8
E:default only supports Firefox------------
E:indeterminate only support Chrome------------
E: Invalid support Firefox, Safari, Opera, Chrome does not support IE8
E:valid support Firefox, Safari, Opera, Chrome does not support IE8
E:required Support for Firefox, Safari, Opera, Chrome does not support IE8
E:optional support Firefox, Safari, Opera, Chrome does not support IE8
E:in-range support Firefox, Safari, opera, Chrome does not support IE8
E:out-of-rang support Firefox, Safari, Opera, Chrome does not support IE8
below for detailed instructions on its use;
1. Selector E:hover, e:active and E:focus
1), the E:hover selector is used to specify the style used by the element when the mouse pointer moves over the element
How to use:
< Elemental >:hover{
CSS Styles
}
We can add the element's type property in < element >.
Cases:
Input[type= "Text"]:hover{
CSS Styles
}
2), the e:active selector is used to specify the style used when the element is activated
3), the E:focus selector is used to specify that the element gets the style used by the cursor focus point, mainly when the text box control obtains the focus point and uses it for text input.
For example:
<! DOCTYPE html>
2. e:enabled pseudo-class selector and e:disabled pseudo-class selector
1), the e:enabled selector is used to specify the style when the element is in the available state.
2), the e:disabled selector is used to specify the style when the element is in an unavailable state.
For example:
<! DOCTYPE html>
3. E:read-only pseudo-class selector and e:read-write pseudo-class selector
1), the e:read-only selector is used to specify the style when the element is in a read-only state.
2), the E:read-write selector is used to specify the style when the element is in a non-read-only state.
<! DOCTYPE html>
4. Pseudo-class selector e:checked, E:default and indeterminate
1), e:cehcked Pseudo-class selector is used to specify the style when the Radio radio box or CheckBox check box is selected in the form.
2), the E:default selector is used to specify the style of the control that is selected by default when the page is opened by a radio box or check box.
3), the e:indeterminate selector is used to specify the style of the entire set of radio boxes when the page is open and none of the radio boxes in a set of radio boxes are set to the selected state.
<! DOCTYPE html>
<! DOCTYPE html>
5. Pseudo-Class selector e::selection
1), e:selection Pseudo-class selector is used to specify the style when the element is selected.
For example
<! DOCTYPE html>
6. E:invalid pseudo-class selector and e:valid pseudo-class selector
1), the e:invalid pseudo-class selector is used to specify the style when the element content cannot be specified by HTML5 by using elements such as requirde, such as attributes such as the check or element content that does not conform to the formatting prescribed by the element.
2), the E:valid pseudo-class selector is used to specify the style when the element content can be specified by HTML5 by using elements such as requirde, such as the check or element content that conforms to the format defined by the element.
For example
<! DOCTYPE html>
7. e:required pseudo-class selector and e:optional pseudo-class selector
1), the e:required pseudo-class selector is used to specify the style of the INPUT element, the Select element, and the textarea element that are allowed to use the required property and have specified the Required property.
2), e:optional Pseudo-class selectors are used to specify the style of input elements, select elements, and textarea elements that are allowed to use the required property and do not specify a required property.
<! DOCTYPE html>
8. E:in-range pseudo-class selector and E:out-of-range pseudo-class selector
1), E:in-range Pseudo-class selector is used to specify the style when the valid value of an element is limited to a certain range, and the actual input value is within that range.
2), E:out-of-range Pseudo-class selectors are used to specify styles that are used when the valid value of an element is limited to a certain range, but the actual input value is exceeded.
For example
<! DOCTYPE html>