Prev | Current Page 113 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"


Selector Reference
69 Selector Reference
We can use the ~= operator to make an attribute selector match elements that have
an attribute that contains a list of space-separated words, one of which is the
specified value:
[class~="warning"] {
?‹® declarations
}
This selector matches any HTML element with a class attribute that contains a
space-separated list of words, one of which is "warning". So it matches class="warning"> and and class="warning highlight">, but not

or class="warnings">.
Compatibility
Opera Safari Firefox Internet Explorer
9.2 3.0 2.0 1.3 2.0 1.5 1.0 7.0 6.0 5.5
Buggy Full Full Buggy Full Full Full Buggy None None
4 See also the :lang pseudo-class (p. 89).
The Ultimate CSS Reference 70
Browsers differ in their treatment of minimized attributes in HTML. For example,
the following HTML input element has a minimized disabled attribute:

The selector input[disabled="disabled"] should match the element above, and
represents the correct way to write the selector.


Pages:
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125