The div element in HTML


 Nest many elements in a single div element:

  • The div element, commonly known as the division element, is a general-purpose container for other elements.
  • The div element is most commonly used element of all HTML elements.
  • Just like any other non-self-closing element, you can open a div element by <div>  and close it on another line by </div>.
  • An example of the usage of div elements: 

<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

No comments:

Post a Comment