[CSS3] Mobile Web development Series CSS3 Enhanced Selector

Source: Internet
Author: User

CSS3 is one of the main technologies of mobile web development. Currently, CSS3 technology is most suitable for use in mobile Web development features with enhanced selectors, shadows, powerful background settings

, rounded border

The next step is to focus on the enhanced selector, which consists of two main types, the attribute selector and the pseudo-class selector.

1. Attribute Selector

1.1 Exact Match Selector

Syntax: [Attribute=value]

<span style= "Font-family:microsoft Yahei;" ><div id= "article" > Attribute matching selector </div><style type= "Text/css" >[id=article]{color:red;} </style></span>

1.2 Include match selector

Syntax: [Attribute*=value]

<span style= "Font-family:microsoft Yahei;" ><div id= "article" > Property matching selector </div><div id= "subarticle" > Property matching selector </div><div id= "Article1 "> attribute match selector </div><style type=" Text/css ">[id*=article]{color:red;} </style></span>
1.3 First character match selector

Syntax: [Attribute^=value]

<span style= "Font-family:microsoft Yahei;" ><div id= "article" > Property matching selector </div><div id= "subarticle" > Property matching selector </div><div id= "Article1 "> attribute match selector </div><style type=" Text/css ">[id^=article]{color:red;} </style></span>
1.4-tailed Character matching selector

Syntax: [Attribute$=value]

<span style= "Font-family:microsoft Yahei;" ><div id= "article" > Property matching selector </div><div id= "subarticle" > Property matching selector </div><div id= "Article1 "> attribute match selector </div><style type=" Text/css ">[id$=article]{color:red;} </style></span>

2. Pseudo-Class selector

CSS3 selectors, there are a lot of pseudo-class selectors, in the CSS2.1 era, pseudo-class selection already exists, such as the four state selectors of the hyperlink

A:link, a:visited, A:hover, a:active

CSS3 adds a lot of selectors, including:

First-line pseudo Element Selector

First-letter pseudo Element Selector

Root Selector

Not selector

Empty Selector

Target Selector




[CSS3] Mobile Web development Series CSS3 Enhanced 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.