CSS3 [attribute$=value] 选择器
实例
设置class属性值以"test"结尾的所有div元素的背景颜色:
div[class$="test"]
{
background:#ffff00;
}
{
background:#ffff00;
}
定义和用法
[attribute$=value] 选择器匹配元素属性值带指定的值结尾的元素。
浏览器支持
所有主流浏览器都支持[attribute$=value] 选择器。
Note: [attribute$=value]在IE8中运行,必须声明<!DOCTYPE> 。

Try it Yourself - Examples
实例
设置class属性值以"test"结尾的所有元素的背景颜色:
[class$="test"]
{
background:#ffff00;
}
{
background:#ffff00;
}