noclist
noclist

Reputation: 1819

CSS - attribute starts with selector?

I have HTML markup that contain randomly generated attributes from Angular. For example,

<i _ngcontent-sgg-c2 class="some-class"></i>

These attributes do not have values so I'm wondering in this case if I can use the [attribute^=value] attribute selector. Am I able to apply styles to all elements where the attributes themselves start with a certain pattern?

Upvotes: 0

Views: 978

Answers (1)

It's not possible to use wildcards on attributes names. See https://stackoverflow.com/a/21222776/3980303 where it was originally answered.

It seems though that the generated attribute of Angular is used for scoped styles. Check this link for reference it explains that good https://dev.to/themeticulist/everything-you-should-know-about-styles-in-angular-12ab

Cheers.

Upvotes: 1

Related Questions