Skip to content
Related Articles

Related Articles

CSS ::first-letter Selector

Improve Article
Save Article
  • Difficulty Level : Medium
  • Last Updated : 19 Oct, 2021
Improve Article
Save Article

The ::first-letter selector CSS Pseudo-element is used to apply the style to the first letter of the first line of a block-level element, the condition is it should not be preceded by other content ( such as images or inline tables).


 ::first-letter {
    // CSS Property

Accepted Properties:

Example: This example illustrates the use of the ::first-letter selector where the color & font-size property is used to style the first letter.


<!DOCTYPE html>
    p::first-letter {
        font-size: 250%;
        color: green;
<body style="text-align: center;">
    <h1 style="color:green;">
        CSS ::first-letter selector
    <p>Geeks classes is an extensive classroom programme.</p>



Supported Browsers: The browser supported by ::first-letter selector are listed below: 

  • Google Chrome 1.0
  • Firefox 1.0
  • Microsoft Edge 12.0
  • Safari 1.0
  • Opera 7.0 Partial from 3.5
  • Internet Explorer 9.0 Partial from 5.5
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!