[attribute$=value]
[attribute$=value] 选择器匹配元素属性值带规定的值结尾的元素。
语法
div[class$="test"] { background:#ffff00; }
值
例子
HTML
<div class="first_test">The first div element.</div> <div class="second">The second div element.</div> <div class="test">The third div element.</div> <p class="test">This is some text in a paragraph.</p>
CSS
div[class$="test"] { background:#ffff00; }
执行结果
The first div element.
The second div element.
The third div element.
This is some text in a paragraph.