CSS [attribute] 选择器
定义和用法
[attribute]选择器选择具有指定属性的元素。
element1 [attribute]也称为简单属性选择器。
简单属性选择器根据属性的存在选择任何元素,而不管属性的值。
例子:
a[rel] {border-bottom: 3px double gray;} p[class] {border: 1px dotted silver;}

实例
浏览器支持
所有主流浏览器都支持 [attribute]选择器。
Note: [attribute] 在IE8中运行,必须声明 <!DOCTYPE> .
相关文章
CSS 教程: CSS 属性选择器

更多建议: