HTML and CSS Reference
In-Depth Information
Name
:focus
Applies to:
An element that has focus
Description:
This applies to an element during the period in which it has focus. One example from HTML
is an input box that has the text-input cursor within it such that when the user starts typing,
text will be entered into that box. Other elements, such as hyperlinks, can also have focus;
however, CSS does not define which elements may have focus.
Examples:
a:focus {outline: 1px dotted red;}
input:focus {background: yellow;}
Note:
:focus support in Internet Explorer applies only to hyperlinks and does not extend to form
controls.
Search WWH ::




Custom Search