text pseudo


While you are learning about text, there are two pseudo - classes that can help you work with text. These pseudo - classes allow you to render either the first letter or the first line of an element in a different way than the rest of that element.


The first - letter Pseudo - Class


The first - letter Pseudo - Class The first - letter pseudo - class allows you to specify a rule just for the first letter of an element. This is most commonly used on the first character of a new page, either in some magazine articles or in books.


Here is an example of the first - letter pseudo - class applied to a <p> element that has a class attribute whose value is introduction .


p.introduction:first-letter {font-size:42px;}


The first - line Pseudo - Class


The first - line pseudo - class should allow you to render the first line of any paragraph differently from the rest of the paragraph.