Css3-New Properties-Property Selector

Source: Internet
Author: User

Before CSS3, the properties were fixed for each HTML tag. However, CSS3 extends the use of the property selector, which allows the user to customize the properties of the label. The following describes how property selectors are used in CSS3, which support only IE7 and later.

The custom properties of the label are consistent with the intrinsic properties of the label, for example, to customize a attribute property for 3 p tags, with the attribute values first, second, and p tags with multiple attribute values "Third1 third2 third3 third4". This is called a list of attribute values

    <p attribute= "First" ></p>

<p attribute= "Second" ></p>

    <p attribute= "Third1 third2 third3 third4" ></p>

With custom attributes, you can add different styles to different properties of the same tag or to different property values of the same property on the same label, and we can only differentiate between different labels based on the class and ID attributes CSS3. The different selection syntax for labels is as follows: the P tag as an example

1. Select only the attribute name, not the exact attribute value

    P[attribute]

2, specify the property name, and specify the property value to see the property

    P[attribute= "Value"]

3. Specify the property name, and specify the property value to start with value

    P[attribute^= "Value"]

4. Specify the property name, and the property value ends with value

    P[attribute$= "Value"]

5, the property name is specified, and the attribute value exists as value in the attribute value list

   P[attribute~= "Value"]

6, specify the property name, and the value of the property contains value

    P[attribute*= "Value"]

7. Specify the property name, and the value of the attribute is value or begins with value-

   P[attribute|= "Value"]

The above is to watch the wonderful taste of the classroom video after the summary notes, hope to see the notes of the students can also practice their own hands, the benefits will be very large.

   

Css3-New Properties-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.