Examples
Example — Nested elements
HTML
<div>
<h2>My favourite fruits</h2>
<ul>
<li>Mango</li>
<li>Banana</li>
</ul>
<p>Elements can be <strong>nested</strong> inside other elements.</p>
</div>
Example — Empty elements
HTML
<p>Line one<br>Line two (br has no closing tag)</p>
<hr>
<img src="https://www.w3schools.com/html/pic_trulli.jpg" alt="Houses" width="180">
br, hr and img are empty elements: they have no content and no closing tag.
Try it Now »