ylbtech-CSS: CSS property selector |
1.Back to top |
1、
CSS property selector
HTML element styles with specific attributes
HTML element styles with specific attributes are not just class and id .
Note: IE7 and IE8 need to declare !DOCTYPE to support attribute selectors! IE6 and lower versions do not support attribute selectors.
attribute selector
The following example turns all elements containing the title blue:
Attribute and value selectors
The following example changes the border style of the title='runoob' element:
Selectors for properties and values - multiple values
The following is an example of an element style that contains a title attribute with a specified value, using (~) to separate the attribute and value:
The following is an example of an element style containing a lang attribute with a specified value, using (|) to separate the attribute and value:
form style
Attribute selector styles do not need to use the form of class or id:
example
input[type="text"] { width:150px; display:block; margin-bottom:10px; background-color:yellow; } input[type="button"] { width:120px; margin-left:35px; display:block; }
2、
2.Back to top |
3.Back to top |
4.Back to top |
5.Back to top |
1、
2、
6.Back to top |
Author: ylbtech Source: http://ylbtech.cnblogs.com/ The copyright of this article belongs to the author and the blog garden. Reprints are welcome, but this statement must be retained without the author's consent, and a link to the original text should be given in an obvious position on the article page, otherwise Reserve the right to pursue legal responsibility. |