How to make first latter big and other small in CSS?

0 votes
33 views
Ravi Vishwakarma asked 7 days ago in Web Application by Ravi Vishwakarma

How to make first latter big and other small in CSS?

1 Answer

0 votes
Ethan Karla answered 5 days ago by Ethan Karla

In this question use the pseudo element selector.

<!DOCTYPE html>

<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <style>
        p::first-letter {
            color: red;
            font-size: 50px;
        }
    </style>
</head>
<body>
    <p>You can use the ::first-letter pseudo-element to add a special effect to the first character of a text!</p>
</body>
</html>