html

HTML template specifications

For the past couple days I have reading up on the new specifications for the <template> tag in HTML 5.1. This new tag allows you to specify a client side template. Although the concept of templates aren’t new its good to see the W3C community coming up with a standard.

In the past to create a “template” you would typically define a div tag with the elements, then you would hide this div by using CSS code display: none

To learn more check out W3C specifications for template.

By |June 26th, 2013|Coding|0 Comments

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>

By |December 22nd, 2010|Coding, Uncategorized|0 Comments