CSS Basic
CSS Styling
CSS Box Model
CSS Advanced
| CSS Attribute Selectors |
Style HTML Elements With Specific AttributesIt is possible to style HTML elements that have specific attributes, not just class and id. Note: Internet Explorer 7 (and higher) supports attribute selectors only if a !DOCTYPE is specified. Attribute selection is NOT supported in IE6 and lower. Attribute SelectorThe example below styles all elements with a title attribute:
Attribute and Value SelectorThe example below styles all elements with title="htmlthai":
Attribute and Value Selector - Multiple ValuesThe example below styles all elements with a title attribute that contains a specified value. This works even if the attribute has space separated values:
The example below styles all elements with a lang attribute that contains a specified value. This works even if the attribute has hyphen ( - ) separated values:
Styling FormsThe attribute selectors are particularly useful for styling forms without class or ID: Exampleinput[type="text"] |
CSS Attribute Selectors