"CSS3"---property selector

Source: Internet
Author: User

In HTML, you can add a lot of additional information to an element through a variety of attributes. For example, a different div element can be distinguished by an id attribute.

Some property selectors have been introduced in CSS2, and CSS3 has extended the attribute selector on the basis of CSS2, adding 3 property selectors, which makes the property selector have the concept of wildcard character . These three property selectors, together with the CSS2 property selector, form the CSS's powerful property selector. As shown in the following table:

Examples show:

HTML code :

<ahref= "Xxx.pdf">I'm linking to a PDF file</a><ahref="#"class= "icon">My class name is icon</a><ahref="#"title= "My title is more">My title is more.</a>

CSS Code

A[class^=icon] {  background: Green;   color:#fff;} A[href$=pdf] {  background: Orange;   color: #fff;} A[title*=more] {  background: Blue;   color: #fff;}

The results show:

"CSS3"---property 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.