Home  »  CodeSnippets   »   CSS Single Rule for Multiple Classes Targeting

CSS Single Rule for Multiple Classes Targeting

Posted: March 5, 2022 | by Michael Bright

HTML code example.

<div class="firstElement">
  ...
</div>

<div class="secondElement">
  ...
</div>

<div class="thirdElement">
  ...
</div>

Corresponding CSS code for the above example.

.firstElement, .secondElement, .thirdElement {
   ...
}

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.