8 CSS selectors explained with example, DOM tree and cheat sheet

Select and style the active link: a:active { background-color: yellow; } Try it Yourself » More "Try it Yourself" examples below. Definition and Usage The :active selector is used to select and style the active link. A link becomes active when you click on it. Tip: The :active selector can be used on all elements, not only links. css :active { /*. */ } Examples Active links HTML html

This paragraph contains a link: This link will turn red while you click on it. The paragraph will get a gray background while you click on it or the link.

CSS css

8 CSS selectors explained with example, DOM tree and cheat sheet

The :active pseudo selector changes the appearance of a link while it is being activated (being clicked on or otherwise activated). It's usually only seen for a split second, and provides visual feedback that the element was indeed clicked. It's most typically used on anchor links ( ). 1 I have an up arrow placed after my select box like so .select-pokemon:after { content: "^"; } However when the select box is showing its options and is selected I want the arrow to display an (x) icon. I have tried .select-pokemon:active:after { content: "x"; } CSS selectors target and select the HTML elements you want to style. Specifically, CSS selectors allow you to select multiple elements at once.. The :active selector applies when the element is selected after being clicked on and after holding down a mouse button: a:active { property: value; } Pseudo-Class Selectors for Inputs . The :active pseudo-class is used to select and style the active link or any other element. It is activated by user. An element becomes active when the user clicks on the link or the element and presses down the mouse button. The :active pseudo-class is used on the and