September 2014
Intermediate to advanced
148 pages
2h 15m
English
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"> ...Read now
Unlock full access