How do you change the color of every first letter of a word using CSS?

1 answer

Answer

1239028

2026-03-23 15:30

+ Follow

This cannot be done using CSS.

However, you can change the font color of the first letter of a paragraph in CSS, like this:

p:first-letter {

color:(color);

}

Alternatives:

span {

color: #XXXXXX; /* Hex Color */

}

Then: The "t" will have a color and so will this one.

Bad thing with this is you may be using the span tags for other things. Then you may want to use a class:

span.first_letter {

color: #XXXXXX; /* Hex Color */

}

Then: The "t" will have a color and so will this one.

You can carry either method out for every first letter. There are some free online text generators that generate Rainbow Text.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.