How to define multiple classes attributes to HTML elements and set CSS style

1 Answer

0 votes
<!DOCTYPE html>
<html>
    <style>
        .class1 {
            background-color: lightcyan;
            padding: 12px;
        }

        .class2 {
            text-align: center;
        }
    </style>
    <body>

        <p class="class1 class2">HTML</p>
        <p class="class1">CSS</p>
        <p class="class1">JavaScript</p>

    </body>
</html>

 



answered Dec 19, 2018 by avibootz
...