Skip Navigation to main content U.S. Department of Energy Energy Efficiency and Renewable Energy
Communication Standards and Guidelines
Communication Standards and Guidelines Home Page Print Guidelines Exhibit Guidelines Web Governance Web Project Management Guidelines Web Content Guidelines Web Technical Guidelines Coding Data Tables Forms HTML Syntax Native File Formats Coding Navigation and Other Links Scripts, Applets, and Dynamic Pages Search Testing Suite Title Tags Content Management System Electronic Newsletters Graphics Multimedia File Naming Conventions and Directory Structure PDFs QA Checklists Redirects and Proxies Templates Technical Maintenance Web Applications Style Guide Glossary Updates to Standards and Guidelines Training Contacts

HTML Syntax

This page describes the requirements for HTML syntax on the EERE Web site. EERE has established the following HTML syntax standards to ensure that our Web sites are accessible to as many users as possible.

  • EERE HTML syntax follows HTML 4.01 Transitional Standards or higher.
  • Special characters should be encoded using character entity references. See the Web Standards Project for more information.
  • All HTML document syntax must be validated by the W3C's validator. The documents must be made as compliant as is possible with regard to EERE's standard browser set and other template requirements.

The Benefits of HTML Syntax Standards

EERE's HTML syntax standards benefit your sites in several ways, including:

Ignoring standards can restrict access to your site

Browsers such as Internet Explorer and Firefox for your desktop computer include a great deal of extra code to deal with syntax errors. They look at invalid code and make a guess as to how it should be displayed. Mobile devices and RSS readers do not have this extra code to handle errors gracefully and may not render poorly formed code correctly or at all.

Using correct syntax paves the way to using XHTML, an XML compatible version of HTML

Using XHTML will enable web authors to leverage tools from the XML world, such as XSLT, to easily manipulate XML data. XML is very strict in regard to syntax and will not work correctly with malformed code.

Standardized code makes it easier for Web developers to assuming management of existing sites written by other developers

Ensuring that code validates to the W3C standards is a very effective way to ensure measurable quality of the final product, the W3C being an impartial judge. Because standards are very well documented, another person taking over some standard-compliant code can hit the ground running and will not need to become familiar with the previous developer's coding practices.

Currently, the EERE template does return one error regarding the search box referencing a non-existent ID. The search box is dynamically sized using JavaScript. The code actually lives in a separate file so that all pages can use it and updates only need to be made in one place. The validator doesn't see this code even though the browser processes it.

The error displays as follows:

  • reference to non-existent ID "SEARCH"
    ...ze: 1px; color: 000066;"><label for="search">Search</label></span><br>

Creating Standards Compliant Code

If you want to create code that is compliant with EERE's technical standards, follow these tips:

  • Use style sheets.
  • Do not use deprecated tags that are being phased out, such as <font> and <center>.
  • Be sure all documents are well-formed (proper nesting).
  • Lowercase all elements and attributes (e.g., tags).
  • Close all nonempty elements (<p> </p>).
  • Quote all attributes (<p align="center">...</p>).