CSS pseudo-Class (pseudo-classes)

Source: Internet
Author: User

Summary: Pseudo-Class (Pseudo classes) is a bolt of a selector that specifies the state of one or its associated selectors. They are in the form of Selector:pseudo class {Property:value;}, and simply use a half-width colon (:) to separate the selectors from the pseudo-class. CSS Many of the suggestions are not supported by the browser, but there are four can be safely used on the hyperlink on the pseudo-class.

: Link is used on an unreachable connection.

: The visited is used on connections that have already been visited.

: Active is used to get the focus (for example, clicked) on the connection.

: hover is used for the connection on which the mouse cursor is placed.

Application scenarios: For example a tag shows different colors in different states

a:link {color: #FF0000}
a:visited {color: #00FF00}
a:hover {color: #FF00FF}
a:active {color: #0000FF}

Need to be aware

Tip: In CSS definitions, a:hover must be placed after A:link and a:visited to be valid.

Hint: In the CSS definition, a:active must be placed after a:hover to be valid.

Tip: The pseudo-class name is not case sensitive.

There are also some common such as: First-child (the application scenario such as the first element of Li and other elements of the style is not the same)

Reference

1.http://www.w3school.com.cn/css/css_pseudo_classes.asp

CSS pseudo-Class (pseudo-classes)

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.