The Attribute Selectors in CSS

by Dinesh 2012-08-28 09:24:13

The Attribute Selectors:


The style rule below will match all input elements that has a type attribute with a value of text:
input[type="text"]{ color: #000000; }

The advantage to this method is that the
element is unaffected, and the color applied only to the desired text fields.
There are following rules applied to attribute selector.
p[lang] - Selects all paragraph elements with a lang attribute.
p[lang="fr"] - Selects all paragraph elements whose lang attribute has a value of exactly "fr".
p[lang~="fr"] - Selects all paragraph elements whose lang attribute contains the word "fr".
p[lang|="en"] - Selects all paragraph elements whose lang attribute contains values that are exactly "en", or begin with "en-".
1016
like
0
dislike
0
mail
flag

You must LOGIN to add comments