Why do we use active in css?
The The Styles defined by the Note: On systems with multi-button mice, CSS specifies that
the CSS
ResultActive form elementsHTML
CSS
ResultSpecifications
Browser compatibilityBCD tables only load in the browser See also
ExampleSelect and style the active link: a:active { Try it Yourself » More "Try it Yourself" examples below. Definition and UsageThe A link becomes active when you click on it. Tip: The :active selector can be used on all elements, not only links. Tip: Use the :link selector to style links to unvisited pages, the :visited selector to style links to visited pages, and the :hover selector to style links when you mouse over them. Note: :active MUST come after :hover (if present) in the CSS definition in order to be effective!
Browser SupportThe numbers in the table specifies the first browser version that fully supports the selector.
CSS Syntax :active { More ExamplesExampleSelect and style a , and element when you click on it:background-color: yellow; } a:link { color: green; } a:visited { color: green; } a:hover { color: red; } a:active { color: yellow; } color: red; } font-size: 150%; } |