Sidebar


Right and Wrong

Centering

If you are centering text do not use the center element since it is not part of the HTML standard.

If you are centering a single paragraph use the align attribute on the paragraph element.

Correct: <p align="center">text</p>
Incorrect: <center>text</center>

If you have multiple paragraphs to center use the align attribute on the div element.

<div align="center">
<p>text</p>
<p>text</p>
<p>text</p>
</div>

Code Nesting

Embed codes in the proper order. First in, last out.

Incorrect: <p><b>text</p></b>
Correct: <p><b>text<b></p>