8
I would like to style only the first letter of each paragraph of my text, but I don’t want to have to separate that letter with a <span>
, because I want to keep the correct semantics of the word, and not have to "break it" with a tag.
For example what I don’t want that’s it:
span {
font-size: 2rem;
font-weight: bold;
color: red;
}
<section>
<h2>Título</h2>
<p><span>L</span>orem ipsum dolor sit amet consectetur adipisicing elit. Ipsum, excepturi.</p>
<p><span>I</span>psum dolor sit amet.</p>
</section>
Is there any way to style with CSS only the first letter for something similar to this image, but without having to separate it into another tag?
Great examples and cases of usso, really there are some "peculiarity" that we should keep in mind!
– hugocsl
+1 Excellent answer, demonstrates some edge cases with enough example and link to documentation. Ball show!
– fernandosavio