Introduction to CSS3 new property selector in HTML5

Source: Internet
Author: User

What is a selector


Using CSS to implement one-to-many or many-to-two controls on elements in an HTML page requires a CSS selector. Selectors are an important part of CSS3, and using CSS selectors can greatly improve the productivity of Web front-end developers when writing or modifying page styles.

Each CSS style definition consists of two parts, in the following form:

selector {style}
The part before {} is the selector. The selector indicates the object of the style in {}, which element the style acts on the Web page.

Property Selector

Attribute selectors in CSS3 in HTML5:

Added three property selectors to CSS: [Att*=val], [Att^=val], and [Att$=val]

[Att*=val] Property Selector

The element uses this style if the value of the attribute represented by an ATT contains the character specified in Val.

[Att^=val] Property Selector

The element uses this value if the first character of the property value of the property represented by the ATT is identifier with the characters specified in Val.

[Att$=val] Property Selector

If the element uses an ATT to represent the property of the attribute value at the end of the character identifier with Val-specified characters, then that element is used in this style.

Introduction to CSS3 new property selector in HTML5

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.