University of Rochester
EMERGENCY INFORMATIONCALENDARDIRECTORYA TO Z INDEXCONTACTGIVINGTEXT ONLY

Validating and Testing

Validating Your Pages


Why Validate?
When you validate your pages, you are ensuring that your code is in compliance with the standards established by the World Wide Web Consortium, or W3C. The W3C has created several standards for coding Web pages. HTML is a standard, as is XHTML. Web pages in the University templates are designed to validate to the XHTML 1.0 Transitional standard supported by the World Wide Web Consortium (W3C).

If your pages are written in valid code, you ensure that they will behave consistently across modern browsers and devices and, perhaps more importantly, with any future devices or software that may come along. Cleaning up broken or nonstandard code makes your pages leaner and easier to maintain, plus leaner code conserves network bandwidth and helps your pages download faster.

NOTE: The HTML 4.01 standard allows tags to be written in uppercase, for example, <P> ... </P>. XHTML, however, requires that all tags be written in lowercase in order for the site to validate. As the templates continue to evolve, this will become increasingly important. It is good practice, then, to write your tags in lowercase, if you do not already do so.

What is a DOCTYPE?
A DOCTYPE (or "document type declaration") establishes which version of HTML or XHTML your pages are written in. It should appear at the top of all the pages in your Web site if you want your pages to validate.

If you are using the University templates, you will see a line of code at the top of each page that reads:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

This is the site's DOCTYPE. Other valid DOCTYPES include:

HTML 4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Strict
<!!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML 1.0 Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

How Do I Validate My Pages?
Use the W3C's Markup Validation Service to validate your pages. Simply enter the URL of the page you wish to validate. You can validate pages that have not yet been deployed to the production server. The validator will present a list of errors on the page, if there are any, along with an explanation of each error. Fix the errors on your page, and then validate again. Continue this process until no errors are reported. Congratulations! Your site is now valid.

University Web Services strongly recommends that Web authors validate ALL the pages on their sites. It is a good practice to validate new pages as they are created, or existing pages as they are modified.

Testing Your Pages

As you create new pages on your Web site, University Web Services recommends that you test them on multiple, modern browsers. These should include (at a minimum):

  • Internet Explorer 7.0 (for Windows)
  • Internet Explorer 6.0 (for Windows)
  • Internet Explorer 5.2 (for Mac)
  • Firefox 2.0 (for Windows or Mac)
  • Safari (for Mac)
  • Netscape 8 (for Windows or Mac)
  • Opera 9 (for Windows or Mac)

In addition, you may want to check your site in an older browser, for example Netscape 4.7. It is not essential that all elements of your site look identical in all browsers, but it is important that the organizational relationships and hierarchy of your content is maintained across all browsers and that the site is usable. Visit University Web Services' Web site usage reports for statistics of browser use.

Finally, it is a good practice to test your site in a screen reader to get a sense of any accessibility issues your users may experience. Rush Rhees Library offers some machines running Jaws, a popular screen reader, that are available for testing purposes.


Content last modified: Monday, 05-Feb-2007 14:42:15 EST
Questions or comments