
By using first-letter
selector we can add style to the first letter of the specified element.
<style> p::first-letter { color:blue; background-color:orange; font-size:50px; } </style> <body> <p>TechFunda.com</p> <p>DotNetFunda.com</p> <p>ItFunda.com</p> <p>KidsFunda.com</p> </body>
In the above code snippet, we have given style to the first-letter of every <p>
element, so that in the output the first-letter of every <p>
element appears with differnt colour, background-colour and size as per the given input.
OUTPUT