How to define the same class attribute to different HTML elements (tags) and set CSS style

1 Answer

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

        <h1 class="test">HTML</h1>
        <p class="test">CSS</p>
        <span class="test">JavaScript</span>

    </body>
</html>

 



answered Dec 19, 2018 by avibootz
...