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ë2y ago
Put the numbers in another span and make that one bigger
Jochem
Jochem2y 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
RikyOP2y ago
Okay. Thanks
ἔρως
ἔρως2y 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?