::first-letter CSS Pseudo Element


The ::first-letter pseudo-element defines the style of the first character in the text of the element to which it is added. Only stylistic properties associated with font properties, margins, indents, borders, color and background can be applied to this pseudo-element.


element::first-letter { … }


<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.,</p>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
 p { 
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
p::first-letter {
font-family: "Times New Roman", Times, serif;
font-size: 2em;
color: red;


In CSS3, pseudo-elements were denoted by two colons to make the syntax different from pseudo-classes. In CSS2, they are indicated by a single colon. Browsers generally understand both syntaxes.

Browser Support

Explorer Edge Chrome Firefox Opera Safari
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung

Last updated by CSSPortal on: 25th November 2019