开发者

How to refer in CSS to all elements that have some attribute?

开发者 https://www.devze.com 2023-01-16 08:44 出处:网络
I know that [开发者_JAVA百科my_attr=\'my_value\'] refers to all elements which have attribute my_attr with value my_value.

I know that [开发者_JAVA百科my_attr='my_value'] refers to all elements which have attribute my_attr with value my_value.

Is that possible to refer to all elements which have my_attr attribute (no matter what the value is) ?


Use [my_attr] alone:

[att] Represents an element with the att attribute, whatever the value of the attribute.


element[attr]

That should do it.

0

精彩评论

暂无评论...
验证码 换一张
取 消