What do you know about the meaning and compatibility of all CSS selectors?

Source: Internet
Author: User

As a web front-end developer, accurate understanding of the meaning and compatibility of each CSS selector can be the first step in the advanced!


CSS selectors can be divided into five categories: element selectors, relationship selectors, property selectors, pseudo-class selectors, and pseudo-object selectors.

One, Element selector

There are 4 element selectors:


Second, the relationship selector

There are 4 relationship selectors:



Third, attribute selector

There are 7 property selectors:


Note: the "string" here includes a space-delimited word and an entire string. For example: "Val" begins with "string" includes: "Val", "Val abc", "Valabc".


four, Pseudo-class selector

There are 23 pseudo-class selectors (regardless of plot style):



Five, pseudo-object selector

A total of 5 pseudo-object selectors:

Note: CSS3 changes the single colon before the pseudo-object selector to double colons, but the previous notation is still valid. E:before and E:after are to be used with the content property, and the value of the content is quoted.

What do you know about the meaning and compatibility of all CSS selectors?

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.