+ 2
How can I put each letter of a word in a color? For example of the word Proud
3 Réponses
+ 2
if you are only using HTML and CSS, you need to wrap each letter in a span tag.
HTML:
<p>
<span class="red">P</span>
<span class="yellow">r</span>
<span class="green">o</span>
<span class="blue">u</span>
<span class="purple">d</span>
</p>
Then specify the colors in CSS:
.red {
color: red;
}
etc....
Or you can apply the color directly to the html tag:
<span style='color: red'>P</span>
+ 1
THANK YOU
+ 1
putréfaction
But if you want to do it for longer words, javascript is the way to do it.
https://code.sololearn.com/WtA1xUc5mCOb/?ref=app