2

I am trying to lowercase all the letters of a line and then capitalize it. I have tried the following code but it only works the last text-transform style:

.lowercase{text-transform: lowercase}
.capitalize{text-transform: capitalize}
<div class="lowercase">
  <span class="capitalize">SURNAME, name</span>
</div>
  • With only CSS, no. You'd need to do one or the other of the two operations via JS. – Mitya Jan 29 '21 at 10:54
  • 1
    Does this answer your question? [First lowercase the text then capitalize it. Is it possible with CSS?](https://stackoverflow.com/questions/5280015/first-lowercase-the-text-then-capitalize-it-is-it-possible-with-css) – Nick Pantelidis Jan 29 '21 at 10:57
  • This worked!!! .lowercase { text-transform: lowercase; } .capitalize::first-line { text-transform: capitalize; } – Jael Zamora Jan 29 '21 at 13:35

0 Answers0