How to select specific tags in a tag

I want to make everything in the div uppercase, except the span that has a "k" in it because it's a small k
No description
4 Replies
Zoë
Zoë3y ago
Put the numbers in another span and make that one bigger
Jochem
Jochem3y ago
you cannot select elements based on their text contents in CSS, so you'll have to add a class to the span with k in it
.stat-group {
text-transform: uppercase;
}

.stat-group .stat.notme {
text-transform: none;
}
.stat-group {
text-transform: uppercase;
}

.stat-group .stat.notme {
text-transform: none;
}
Riky
RikyOP3y ago
Okay. Thanks
ἔρως
ἔρως3y ago
a terrible alternative is to use the :first-child selector or, instead of extra classes, you can use a data attribute, like data-unit="k" and target that instead

Did you find this page helpful?