Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Wildcard element name selection

Tags:

html

css

Is there a way to select an element by name in CSS using a wildcard?

For example, with these elements:

<my-element-one></my-element-one>
<my-element-two></my-element-two>
<div></div>

Could I only select every one starting with 'my-element'? For example like this:

my-element-* {color: red;}
like image 844
HotStuff68 Avatar asked Jun 18 '26 02:06

HotStuff68


1 Answers

No. Only attribute selectors have any kind of wildcard syntax in CSS.

It sounds like your XML application design might be better off using fewer types and using attributes to distinguish between subsets of them.

like image 102
Quentin Avatar answered Jun 20 '26 17:06

Quentin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!