看那里:
<style>
a[target="_blank"]{
color: red;
}
</style>
<a target="_blank">Im Red</a>
<br>
<a>Im Normal</a>
它是正确的,但我可以拥有属性值吗?
喜欢此:
<style>
*[colorAttrib]{
color:/* value of colorAttrib */;
}
</style>
<p colorAttrib="red">I Want To Be Red</p>
<p colorAttrib="blue">I Want To Be Blue</p>
<< FIRST段落是RED,SECOND段落是BLUE。