There is no :nth-letter
pseudo-element (and no :first-char
) in CSS. The :first-letter
pseudo-element (which the question mentions in the title and in the prose but does not use in the code) works, but to color other letters, you must wrap each of them in an element of its own, normally span
.