I know that ::first-letter
selects the first letter of a block-level element.
How can I select all text except the first letter?
I tried :not(::first-letter)
but that didn't select anything.
:not
can only be applied to simple selectors. Pseudo-elements aren't simple selectors, so you can't invert them.
You could apply the "non-first letter" styles to all of the text and reverse them for the first letter.
For example:
p {
color: red;
text-transform: uppercase;
}
p::first-letter {
color: black;
text-transform: none;
}
<p>red capitals except the first letter.</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With