You should wrap every single word with a tag and use ::first-letter
CSS selector .
Also, note that this selector does not work on inline elements. If you want to use it with an inline element, such a <span>
, make sure you set display:inline-block
(see here for more details: https://stackoverflow.com/a/7631782/11298742)
example :
p span { display: inline-block; font-family: 'Roboto', sans-serif }
p span::first-letter {
color: red;
font-weight: bold;
}
<p><span>Lorem</span> <span>ipsum</span> <span>dolor</span> <span>sit</span> <span>amet</span></p>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…