开发者

Quick CSS query

开发者 https://www.devze.com 2023-04-11 23:57 出处:网络
Is there a shorter way of writing this? .form1 input[group=\"write\"], .form1 select[group=\"write\"], .form1 textarea[group=\"write\"] {开发者_Python百科 display: none; }

Is there a shorter way of writing this?

.form1 input[group="write"], .form1 select[group="write"], .form1 textarea[group="write"] {开发者_Python百科 display: none; }

the group is just an attribute i use to group inputs.

ideally Id like

.form1 (input|select|textarea)[group="write"] { display: none; }


Not sure why you're not using class to group your form elements instead of a custom attribute like group, but anyway, I suppose this catch-all rule will do:

.form1 [group="write"] { display: none; }

If you need to explicitly match input, select and textarea elements only, there's no shorter way in CSS3 than what you have.

0

精彩评论

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

关注公众号