Ten Pseudo Classes pseudo class

Source: Internet
Author: User

A pseudo class is like a latch that specifies the selector State or association selector. They are in the form of:Selector:pseudo class {Property:value}, using a colon between selectors and pseudo properties.

Some properties are not supported by all browsers, but there are four pseudo classes that can be safely used on links.

  • linkNo clicked Links
  • visitedBy clicking on the link
  • activeLinks when getting focus (for example, when clicked)
  • hoverMouse on the link above
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 they can be omitted from CSS, it is a good practice to maintain links of different colors for beginners. Because pseudo classes (compared hover to) are not used frequently, they are very unfortunate features as public properties. Because of this, it is not as important as it used to be, but it should be used if it is considered for the optimal user response.

Traditional default, the text link is blue, after the visit is purple, theoretically can use a lot of different color effects, but, again, gradually extensive use of CSS, so that links become no longer common, the average user no longer think the link must be blue or purple.

You can also use pseudo classes in addition to linking other elements hover . Unfortunately, the browser below IE7 does not support, so there are many beautiful effects can not be implemented on IE.



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.