Main Content

HTML

CSS and Scripts

Elements like CSS and scripts should exist separately from the HTML code itself.

CSS

All styling should be handled externally from the HTML by using CSS.  The CSS code should also live externally in a separate .css file that the HTML simply includes within the head tags.

Java Script*

The JavaScript functions should live externally from the HTML in a .js file.  Calls to the .js file and functions should be the only JavaScript code included within the HTML file itself.

When using JavaScript in a page, the Page and content should continue to be available, accessible, and functional when JavaScript is disabled.  An example outside of navigation and linking to content in new windows would be to have the answer to a question hidden until the user initiates an action to reveal the answer such as clicking on a button.  When JavaScript is disabled, you may loose the intended purpose however, the answer should reveal itself in the initial rendering of the page.


Top of page