HTML CSS examples for CSS Selector:first-letter
The ::first-letter selector selects the first letter of the specified element.
The ::first-letter selector can only be used with block-level elements.
The following properties can be used with ::first-letter.
Select the first letter of every <p> element:
<!DOCTYPE html> <html> <head> <style> p::first-letter { font-size: 200%; color: red; } </style><!--from ww w .j av a 2 s .co m--> </head> <body> <h1>Welcome to My Homepage</h1> <p>this is a test.</p> <p>this is a paragraph.</p> <p>I <b>like</b> css.</p> </body> </html>