Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 878 Bytes

11. HTML Style Guide and Coding Conventions.md

File metadata and controls

30 lines (21 loc) · 878 Bytes

HTML Style Guide and Coding Conventions Link for full article

image image

Trailing slashes

Don't include XHTML-style trailing slashes for empty elements, as they are unnecessary and slow things down. They can also break old browsers if you are not careful (although from what we can recall, this hasn't been a problem since Netscape 4).

This is fine:

<input type="text">
<hr>

The slashes are not needed:

<input type="text" />
<hr />

Use double quotes

Use double quotes for HTML, not single quotes:

<p class="important">Yes</p>
<p class='important'>Nope</p>