CSS Pseudo-class :focus
Description:The :focus pseudo-class is used to add special effect to an element while the element has focus. While defining pseudo-classes in a <style>...</style> block, following points should be taken care:
Possible Values:
Applies to:Anchor / Link element. Example:Following is the example which demonstrates how to use :focus class to change the color of focused links.
This will produce following link. This will change it color to orange when this link gets focused, then you focus on any other link to see that this color will change when it will lose focus.
|