I read elsewhere that the following should capitalize the first letter of the text of an inline element (e.g. a <span>
).
However, if you run the code snippet you'll see that it doesn't work. If I replace the <span>
with a <div>
it works, but is there a way to capitalize the first letter without changing the element type?
.list .capitalize:first-letter {
text-transform: capitalize;
display: inline-block;
}
<div class="list">
<span class="capitalize">capitalize me</span>
</div>