I am trying to change each letter styles but I'm restricted from using javascript
and without using span for each letters , I searched got some pseudo nth-letter
but this not working , I know this type of question asked before but the restrictions force me to add this question.
please give some suggestions , it is really helpful
.change:nth-letter(3)
{
color:red;
font-size:20px;
}
<p class="change"> Color </p>
This is a hack that uses:
background-clip: text
to clip the background on to the textlinear-gradient
to color each letterSee demo below:
.change {
font-size: 20px;
font-family: monospace;
display: inline;
-webkit-background-clip: text;
background-clip: text;
color:transparent;
background-image: linear-gradient(to right, black 40%, red 40% 60%, black 60%);
}
<p class="change"> Color </p>