Little Web Hut
(Cascading Style Sheets) CSS 2.1 Reference

CSS Pseudo-element :first-letter Selector

 

What is a CSS Pseudo-element :first-letter Selector?

  • The :first-letter pseudo-element selector specifies the first letter of the first line of text in a block. This selector does not apply if the first letter is preceded by other content e.g., an image. In the following example, the font property will be set for the first letter in the <p> element.
CSS Example:
  p:first-letter {font: italic bold 2em cursive;}
  <p>The font property is applied to the first letter of this text.</p>
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style