HTML Style Guide
-
Always Declare Document Type
<DOCTYPE html> -
Always Use Lowercase Element Names
-
Close ALL HTML Elements
This normally does not include empty elements. However, XML and XHTML do require you to use the closing slash /.
Always Use Lowercase Attribute Names
Always Quote Attribute Values
Always Specify alt, width, and height for Images
Do NOT Insert Spaces Between Equal Signs
NEVER Skip the title Element
-
ALWAYS Include the lang Attribute
This goes inside the
<html>tag. It assists search engines and browsers. -
Declare Char Encoding ASAP
<meta charset="UTF-8"> -
Set the Viewport in All Pages
<meta name="viewport" content="width=device-width, initial-scale=1.0">