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

Asked 19-Jul-2021
Viewed 177 times

0

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


1 Answer


1

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>


Loading...
Ads