Abakada: Back to Basics > Language References > CSS Properties > Pseudo-Classes > first-letter Pseudo-class
Sets styles to the first letter of the first line of a block container.
selector::first-letter { property: value; }
property |
Any valid CSS property. |
value |
Any of the range of values available to the corresponding property. |
The ::first-letter pseudo-class applies styles to the first letter of the first line of a block container.
The syntax for using the ::first-letter pseudo-class is straightforward. A selector immediately precedes the pseudo-class.
For example, to change the color of first-letter elements on a page.
p::first-letter { color: sienna }
The following demonstrates use of the ::first-letter pseudo-class in an embedded stylesheet to set the style of first-letter elements on a page.
::first-line