Administrative Computing Developer Resources
 
S A P Development Standards Web Development Standards Quality Assurance Glossary    

Rule #3: Check your head.

The easiest way to describe where to locate header elements is with HTML pseudo-code. An asterisk (*) denotes a required page element.

  <XML>
* <DTD>
* <HEAD>
    <SERVER></SERVER>
*   <TITLE></TITLE>
*   <META>...
    <LINK />
    <STYLE></STYLE>

    <SCRIPT></SCRIPT>
  </HEAD>

In real code all your elements should be lower case for XML compliance.

XML
This is the XML version declaration. This is for XHTML pages only, so ignore this for previous versions of HTML. The precise form varies depending on your server-side platform.

DTD
This is the document type definition. It's always present.

HEAD
This is the HTML <head></head> tag. It's always present. Its form varies depending on the DTD.

SERVER
This is for your initial block of server-side variables. The form depends on your server-side scripting language, such as <% %> for JSP Scriptlets. This code may result in dynamic output needed by the rest of the header content, which is why it is first. It's inside the <head></head> for RAD tool compliancy (GoLive, Dreamweaver).

Server-side procedures should be included before local variables are defined.

TITLE
This is the page title that appears in the window pane of the browser application. While not explicitly required by any HTML specification, not having one is considered extremely poor form and will cause your page to show up poorly in web search engines.

META
Any and all meta declarations. Technically, meta declarations are not required by a web browser, but some are required by Administrative Computing: Internet Design and Development Team (IDD).

LINK
This is the the HTML <link /> tag for including external CSS files. External, shared CSS definitions should be included in the web page before the place where you define local styles (see STYLE, below.

STYLE
This is the the HTML <style></style> tag for defining CSS styles local to the current web page.

SCRIPT
External client-side JavaScript files should be included before local client-side variables are defined.

M I T
I S and T

© Copyright 2002 by the Massachusetts Institute of Technology, Cambridge, MA, USA.
View the full Copyright Notice and Disclaimer.