CSS Pseudo-element ::first-letter
Creates
A pseudo-element which contains the first letter of an element.
Description
This selector is used to set specific styles for the first letter of an element. If there are any punctuation characters before the actual first-letter, the styles will be applied to them too. Before CSS2.1 :first-letter
could only be used for block-elements. CSS2.1 extends the selection to all elements with the display
-values block, list-item, table-caption, table-cell
and inline-block
. The style-possibilities for first-letter
are limited.
Examples
Compatibility
Chrome | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|
1+ | 1+ | 5.5+ | 3.5+ | 1+ |