CSS Text Pseudo-Class Property


First-letter Pseudo-class
The first-letter pseduo-class to specify a rule just for the first letter of an element.The first-letter pseduo-class applied to a element.

First-line Pseudo-class
The first-line pseudo-class to render the first line of any paragraph differently from the rest of the paragraph.The name of the pseduo-class is separated from the selector for the element by a colon:

Example

  <!DOCTYPE html>
   <html>
    <head>
    <style type="text/css">
     .one:first-letter{
       font-size:50px;
      }
     .one:first-line{
      font-weight:bold;
      }
    </style>
    </head>
    <body>
    <p class="one">
    One upon a time , there was a pseduo-class that allowed you 
    tospecify a different rule for the first letter of an element's 
    content , and anthor that allowed you to specify a different rule 
    for the whole of the first line.
    </span> 
    </body>
   </html>
Output

One upon a time , there was a pseduo-class that allowed you tospecify a different rule for the first letter of an element's content , and anthor that allowed you to specify a different rule for the whole of the first line.


Share this article on