<p class="alert">This is an announcement.</p>
<p class="alert caution">Proceed with caution.</p>
<p class="alert caution">Proceed with caution.</p>
<p class="alert">This is an announcement.</p>
<p class="alert caution">Proceed with caution.</p>
<p class="alert">This is an announcement.</p>
<p>Paragraph element.</p>
<p class="alert caution">Proceed with caution.</p>
<p>Paragraph element.</p>
.alert { /* Selects the alert class: .class selector */
    padding: 0.5em;
    background-color: gold;
}
.caution { /* Selects the caution class: .class selector */
    color: orangered;
}
Rendered Output
<style>
    div { /* Styles all div elements */
        padding: 0.5em;
        border: 1px solid red;
        margin-bottom: 0.5em;
    }
    .box { /* Adds a background color only to div elements with the box class */
        background-color: gold;
    }
</style>

<div class="box">box class</div>
<div class="box">box class</div>
<div class="box">box class</div>
<div class="box">box class</div>
<div>div</div>
<div>div</div>
<div class="box">box class</div>
<div class="box">box class</div>
<div>div</div>
<div class="box">box class</div>
<button id="highlight-button" type="button">Click to Change Text</button>

<script>
    const highlightButton = document.getElementById("highlight-button");

    highlightButton.addEventListener("click", () => {
        // document.querySelectorAll(".box") : Selects all elements with the class name "box"
        const boxes = document.querySelectorAll(".box");

        boxes.forEach(box => {
            box.innerHTML = "Hello from the box class.";
        });
    });
</script>
Rendered Output Try clicking the button!
<p class="a" class="b">You can specify multiple class names for a single HTML element.</p>
<p class="a b">You can specify multiple class names for a single HTML element.</p>