CSS3 Property Selector

Source: Internet
Author: User

Demo Content

Use the element attribute in the selector to get the specified element attribute or the element syntax that is worth it:

[Properties]: All elements with the specified attributes are all matched

element [Property]: matches the specified element with attributes

P[id]: Match p element with id attribute
Div[class]:
element [attribute 1][property 2]:
P[id][class]: Matches all P elements that have an id attribute and a class attribute
element [attribute = value]:
Input[type= "Text"]: the input element that matches the type value of text
element [attribute ~= value]:
Input[class ~= Second]:
<input class= "First Second"/>
<input class= "Myseconddiv"/>

~=: Contains the specified data (standalone)
=: only the specified data
element [attribute ^= value]: matches the specified element that specifies the value at which the specified property starts
P[CLASS^=F]: matches the P element with class starting with F
<p class= "First" ></p> can match
<p class= "Fast" ></p> can match
<p class= "Second" ></p> cannot match
element [attribute *= value]: property contains value element
p[class*= "valid"];
<p class= "Myvalid" ></p>
element [attribute $= value]: The element that matches the property to specify the end of the value
Element [Property! = value]: The match attribute is not equal to a specific merit element

eg
Input[id]: Gets the INPUT element with the id attribute
<input type= "Text"/>
<input type= "Radio" id= "Rdogender"/>

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.