Skip to main content

Rule Five - Elements must be properly nested

All elements must be properly nested. This means that if you start with a bold tag and then a paragraph, you have to stop the paragraph tag first and then the bold.

The following is correct because the bold tags are inside of the two <p> elements:

<p><b>This is a bold statement</b></p>

<p>This is a <b>second</b> paragraph</p>

This markup is incorrect because the stop bold tag happens after the paragraph tag. The bold element is overlapping the paragraph element.

<p><b>This is a bold statement</p></b>

<p>This is a <b>second</b> paragraph</p>