CSS [attribute] 選擇器
定義和用法
[attribute]選擇器選擇具有指定屬性的元素。
element1 [attribute]也稱為簡單屬性選擇器。
簡單屬性選擇器根據(jù)屬性的存在選擇任何元素,而不管屬性的值。
例子:
a[rel] {border-bottom: 3px double gray;} p[class] {border: 1px dotted silver;}

實例
瀏覽器支持
所有主流瀏覽器都支持 [attribute]選擇器。
Note: [attribute] 在IE8中運行,必須聲明 <!DOCTYPE> .
相關(guān)文章
CSS 教程: CSS 屬性選擇器

更多建議: