Topic: CSS Basics

div element – HTML


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

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

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