Please note that some CSS pseudo-class attributes are not supported by all browsers, but four pseudo-classes can be safely used on links.
A pseudo-category is like a bolt that specifies the selector status or associates a selector. Their form is as follows: selector: pseudo class {property: value;}. Use a colon between the selector and pseudo attribute.
Links that have not been clicked
Visited to the clicked link
Link when active Gets focus (for example, when clicked)
Hover mouse over the link
The code is as follows: |
Copy code |
A. snowman: link { Color: blue; } A. snowman: visited { Color: purple; } A. snowman: active { Color: red; } A. snowman: hover { Text-decoration: none; Color: blue; Background-color: yellow; }
|
Although CSS can omit them, maintaining links of different colors is a good exercise for beginners. Since pseudo classes (compared with hover) are not frequently used, it is unfortunate to use them as public attributes. As a result, it is not as important as before, but should be used for optimal user response considerations.
By default, text links are blue and purple after access. In theory, many different colors can be used. However, CSS is gradually used, making links no longer common, the average user no longer thinks that the link must be blue or purple.
Besides linking other elements, you can also use the hover pseudo class. Unfortunately, browsers below ie7 do not support this, so many nice effects cannot be achieved on IE.