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 the full tutorial, sign up for a free trial on our Sign Up page.