HTML Coding Tips
- Use all lower case for tags and elements.
- Properly align opening and closing tags using multiple lines and tabs.
- Use css to control page borders.
- Use space after commas ( ex: word 1, word 2 ).
- Always use comments so other developers/designers can understand what you were trying to do.
- Always use the id element and use the proper naming convention:
- image: imgMyPicture
- link: lnkMyLink
- div layer: dvLayerOne
- p: pParagraphOne
- Tags must have an end tag, or be closed within the singleton tag itself, for example <br />
- Use double quotes for all attributes.
- Use seperate files for scripts & css definitions.
- Always declare your document:
<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”>
</html>