Barbara Leeds > Samples >
To ensure that your web page works properly with a wide variety of user agents, it is important to meet standards. The World Wide Web Consortium (W3C) provides free validation services to check your pages.
Open the W3C Markup Validation Service: http://validator.w3.org/. Choose one of the options:
Note: If your page is behind a firewall (perhaps in a corporate intranet), you may not be able to validate by URL. In this case, make sure the page exists as a file on your computer (copy it if necessary) and validate by file upload, or copy the contents of the file into the validator screen and validate by direct input.
Specify an appropriate doctype (plus namespace for an XHTML page) at the beginning of the document, before the <head>. For example:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
or
<!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" lang="en">
Specify an appropriate Content-Type metatag at the beginning of the <head>. For example:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Remove presentational markup from your (X)HTML page. Instead, use semantic markup and external stylesheets.
To achieve symmetrical open- and close-quotes (‘ and ’ or “ and ”)—as opposed to typewriter-style identical quotes (' or ")—that display properly and validate, use the following entities:
Symbol Name | Appearance | Entity |
---|---|---|
Open single-quote | ‘ | ‘ |
Close single-quote (apostrophe) | ’ | ’ |
Open double-quote | “ | “ |
Close double-quote | ” | ” |
For example, to display this:
He asked, “Is that ‘Little Maggie’?”
code this:
He asked, “Is that ‘Little Maggie’?”
Note: Microsoft products may insert noncompliant entities as “smart quotes”; change them to the entities listed above.
If you have errors, correct them one by one, from the beginning. Correcting an early error may resolve several later errors.
The W3C allows you to add their compliance icon to any page that validates (see below). The icon is clickable, so that you (or anyone else) can easily revalidate the page.
barbaraleeds@yahoo.com |