CSS: focus selector
CSS selectors complete reference manual
Examples
An input pattern selected when the field receives the focus:
input: focus
{
background-color: yellow;
}
{
background-color: yellow;
}
try it"
Definition and Usage
: Focus selector for selecting the element has focus.
Tip:: focus selector accepts keyboard events or other elements of the user input.
Browser Support
Figures in the table represent the first browser to support the version number of the property.
选择器 | |||||
---|---|---|---|---|---|
:focus | 4.0 | 8.0 | 2.0 | 3.1 | 9.6 |
Note:: focus selector selector must be declared in IE8 <DOCTYPE!> .
related articles
Tutorial the CSS: the CSS pseudo-classes