Reputation: 57
Is it possible to do so like with links (a[href="/"]{_/*CSS declarations.*/_}
)?
For example:
#example > .meow span[style="color:red;"] {
text-transform: lowercase;
}
#example > .woof span[title="I'm a dog."] {
color: blue;
text-decoration: underline;
}
Upvotes: 1
Views: 32
Reputation: 8365
Yes you do that :
See below code
a[href="https://www.css-tricks.com"] {
color: #E18728;
font-size: 1.5em;
}
#example > .meow span[style="color: red;"] {
text-transform: lowercase;
font-size: 45px;
}
<p><a href="https://www.css-tricks.com">CSS-Tricks</a></p>
<p><a href="https://www.css-tricks.com/almanac">CSS-Tricks Almanac</a></p>
<hr>
<div id="example">
<div class="meow">
<span style="color: red;">TEST</span>
</div>
</div>
For more exmaples follow this - post here
For documentation - Attribute selectors documentation
Upvotes: 3