70th section, CSS Selector

Source: Internet
Author: User

CSS Selector

Learning Essentials:
1. Selector Hub
2. Basic Selector
3. Composite Selector
4. Pseudo element Selector

This chapter focuses on the CSS selector in HTML5, where you navigate to the element where you want to set the style. The current version of the CSS selector has been upgraded to the third generation, the CSS3 selector. The CSS3 selector provides more and richer selector methods, which are divided into three major categories.

A Selector hub

This lesson is mainly about three selectors: basic selector, composite selector, and pseudo-element selector, as follows:

Selector Name Description CSS version

* Universal Selector selects all elements 2

<type> element Selector Select element of the specified type 1

#<id> ID Selector Select element of the specified ID attribute 1

The .<class> class selector selects the element that specifies the class attribute 1

[attr] Series Property Selector Select the element that specifies the Attr property 2 ~ 3

S1,s2,s3 ... Grouping selectors select elements of multiple selectors 1

S1 s2 descendant Selector Select the descendant element of the specified selector 1

S1 > S2 Sub-selector Select the child element of the specified selector 2

S1 + s2 Adjacent sibling selector Select the element adjacent to the specified selector 2

S1 ~ S2 Ordinary Brother Selector Select the element following the specified selector 3

:: First-line pseudo-Element selector selects the first line of block-level element text 1

:: First-letter pseudo-Element selector selects the first letter of block-level element text 1

:: Before pseudo element selector insert content before selecting elements 2

:: After pseudo element selector selection element Insert content 2

70th section, CSS Selector

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.