Topic: CSS Basics

div element – HTML

Preview

To group multiple elements together and style them, use the div element with a class or id attribute:

<div class="my-class">
  <h1>Group</h1>
  <p>The heading element and this paragraph will share similar styles.</p> 
</div>

To view this and the other 300+ tutorials on Simple Dev, sign up for a 10-day free trial.