CSS pseudo-class selector detailed parsing and case use-----pseudo-class selector (1)

Source: Internet
Author: User

  1. Dynamic pseudo-Class selector:
    E:link: Select the matching e element, and the matching element is defined and the hyperlink has not been accessed.
    e:visited: Select the matching e element, and the matching element is defined and has been accessed.
    E:active: Selects the matching e element, and the matching element is activated. Often used on anchor points and buttons.
    E:hover: Selects the matched e element, and the user mouse rests on the element.
    E:focus: Selects the matched e element, and the element receives focus.

    The anchor pseudo-class set adheres to the "love and Hate Principle", that is, love/hate, that is, "link-visited-hover-active".

  2. Target pseudo-Class selector (this is a dynamic selector, the style effect takes effect only if there is a URL pointing to the matching element)
    E:target: Matches the child element below the e element, the child element that is linked to by the URL.
    In the example below, the element that is matched by #div1:target is #div2, which is not only a child of #div1, but is also pointed to by the URL (a tag href= "#div2"). Two conditions are indispensable. (This is self-understanding, unofficial explanation).
    <! DOCTYPE html>

      

  3. Language pseudo-Class selector:
    E:lang (language): Selects all elements that match E, and the matching element has the lang attribute, and its value is language.
    There are two ways to set up a document language. First, if you use HTML5, you can set this:

    or manually specify in the document:

    <lang= "fr">

  4. UI element State pseudo-class selector:
    E:checked: Matches a selected check button or radio button FORM element
    E:enabled: Match all enabled form elements
    E:disabled: Match all disabled form elements

CSS pseudo-class selector detailed parsing and case use-----pseudo-class selector (1)

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.