HTML and CSS Reference
In-Depth Information
Chapter 4
Attribute selectors
Attribute selectors allow style to be added to elements based on their attributes and
attribute values.
Attribute selector
The attribute selector will match elements that use the specified attribute, regardless
of its value.
input[type] {}
This selector will match only input elements that use the type attribute, such as the
following element:
<input type="text">
Attribute value selector
The [attribute=value] selector will match by both attribute and value.
input[type="submit"] {}
Input elements that have their type attribute set to submit will be matched by this
rule, as in the following example:
<input type="submit">
Language attribute selector
The language attribute selector is used to match the lang attribute.
p[lang|="en"] {}
Search WWH ::

Custom Search