CSS tutorial 10. Pseudo class of CSS

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.