Help For The W3C Markup Validation Service
Help For The W3C Markup Validation Service
Table of contents
1. About the Markup Validator
a. Help me! I clicked on an icon and ended up on this strange site!
b. What is Markup Validation?
c. Is validation some kind of quality control? Does "valid" mean "quality
approved by W3C"?
d. Is validity the same thing as conformance?
e. What is the Markup Validator and what does it do?
f. Why validate?
g. Who owns/maintain the Markup Validator?
h. What other validators are there?
i. How does The Validator work?
j. How do I send feedback/bug reports about the Markup Validator?
2. Using this service
a. How do I use the Markup validator?
b. What is (are) this (these) error message(s)?
c. Many error messages? Don't panic.
d. I don't want error messages, I want you to clean up my page!
e. "valid" icons
i. My document is valid, can I use your "valid" icon?
ii. Is there a list of all available icons somewhere?
iii. Why do I see warnings about "insecure items" when viewing my
page after including the icon?
iv. License and Guidelines for usage of the "valid" icons
v. Can I modify the existing icons to create my own?
vi. I saw the "valid" icon displayed on a site but the page is invalid.
What should I do?
http://validator.w3.org/docs/help.html
1/10
10/25/2015
Don't panic!
The author of the Web page you come from once used our service to validate that
page, and the page passed validation. The author was then authorized to use the
icon on that page, as a claim of validity. The icon is used as a link back to the
validation service, so that the author can revalidate whenever necessary. This is
why, by clicking on the icon, you followed a link to the current validation results
for the page you came from.
The validation result was certainly positive ("this page is valid..."), but if it wasn't,
you would probably do the author of the page where the icon was a favor if you
could warn him/her of this abnormal situation.
If you are curious about Markup validation you may read this help document
further, or you may simply use the back button of your Web browser to come
back to the page where you found the "valid" icon.
What is Markup Validation?
Most pages on the World Wide Web are written in computer languages (such as
HTML) that allow Web authors to structure text, add multimedia content, and
specify what appearance, or style, the result should have.
As for every language, these have their own grammar, vocabulary and syntax,
and every document written with these computer languages are supposed to follow
these rules. The (X)HTML languages, for all versions up to XHTML 1.1, are using
http://validator.w3.org/docs/help.html
2/10
10/25/2015
Validity is one of the quality criteria for a Web page, but there are many others. In
other words, a valid Web page is not necessarily a good web page, but an invalid
Web page has little chance of being a good web page.
For that reason, the fact that the W3C Markup Validator says that one page
passes validation does not mean that W3C assesses that it is a good page. It only
means that a tool (not necessarily without flaws) has found the page to comply
with a specific set of rules. No more, no less. This is also why the "valid ..." icons
should never be considered as a "W3C seal of quality".
Is validity the same thing as conformance?
The Markup Validator is a free tool and service that validates markup: in other
words, it checks the syntax of Web documents, written in formats such as
(X)HTML.
The Validator is sort of like lint for C. It compares your HTML document to the
defined syntax of HTML and reports any discrepancies.
http://validator.w3.org/docs/help.html
3/10
10/25/2015
Learn more about the Markup Validator and the languages it can validate.
Why should I validate my HTML pages?
We're doing our best to provide clear and reliable results as well as a good
interface with the Markup Validator, but for some reason you may want to check
other validators. Here are a few choices:
Page Valet, part of the Site Valet suite.
WDG's HTML validator
Looking for validators at W3C, but not the Markup Validator? Check out the list of
validators at W3C, including well-known CSS validator, link checker, etc.
How does The Validator work?
4/10
10/25/2015
Most probably, you will want to use the online Markup Validation service. The
simple way to use this service to validate a Web page is to paste its address into
the text area on the validator's home page, and press the "Check" button.
There are other possible uses and a few usage options, please read the user's
manual for further help with this service.
If, for some reason, you prefer running your own instance of the Markup
Validator, check out our developer's documentation.
What are these error messages?
The output of the Markup Validator may be hard to decipher for newcomers and
experts alike, so we are maintaining a list of error messages and their
interpretation, which should help.
Many error messages? Don't panic.
Don't panic. Did The Validator complain about your DOCTYPE declaration (or
lack thereof)? Make sure your document has a syntactically correct DOCTYPE
declaration, as described in the section on DOCTYPE, and make sure it correctly
identifies the type of HTML you're using. Then run it through The Validator again;
if you're lucky, you should get a lot fewer errors.
If this doesn't help, then you may be experiencing a cascade failure one error
that gets The Validator so confused that it can't make sense of the rest of your
page. Try correcting the first few errors and running your page through The
Validator again.
Be patient, with a little time and experience you will learn to use the Markup
Validator to clean up your HTML documents in no time.
I don't want error messages, I want you to clean up my page!
Have a look at tools such as HTML Tidy and tidyp. When selected, the "Clean up
Markup with HTML-Tidy" option will output a "cleaned" version of the input
document in case it was not valid, done with HTML-Tidy, using the Markup
Validator's default HTML-Tidy configuration. Note that there are no guarantees
http://validator.w3.org/docs/help.html
5/10
10/25/2015
about the validity or other aspects of that output, and there are many options to
configure in these tools that may result in better clean up than the Validator's
default options for your document, so you may want to try out them locally.
"valid" icons
My document is valid, can I use your "valid" icon?
Yes. To show readers that one has taken some care to create an
interoperable Web page, a "W3C valid" badge may be displayed (here, the "valid
XHTML 1.0" badge) on any page that validates.
We encourage you to use the XHTML code below (or its HTML equivalent), but
you may use a different code to integrate the icon within your web page as long
as the icon is used as a link to revalidate the Web page it is in. Sample code is as
follows:
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0!" height="31" width="88" /></a>
</p>
Many browsers display this warning when viewing documents transferred over a
secure protocol such as HTTPS if the documents contain items that are
transferred over a non-secure protocol such as unencrypted HTTP. As W3C does
not currently provide the "valid" icons over HTTPS, you may want to copy and
serve the icons from a HTTPS enabled server elsewhere and link to those copies
instead of the W3C originals in your documents that are transferred over a secure
protocol to avoid this warning. See also HTTPS related documentation in the
"/check?uri=referer" FAQ entry.
License and Guidelines for usage of the "valid" icons
Web content providers are granted the right to use the "W3C valid" logo on pages
that pass validation (through the use of the W3C Markup Validator) for the W3C
technology represented by the icon, and only on pages that pass validation. The
http://validator.w3.org/docs/help.html
6/10
10/25/2015
icon must be used as a link to revalidate the Web page, thus providing a way to
verify the page author's assertion that it passed validation.
Note that "W3C Valid" icons are not an endorsement by the W3C of the page's
author, the substantive content of the page, nor its design. Instead, the icons are
only a mechanism to identify pages that have been determined to be valid, and to
easily revalidate pages as often as as they are modified.
Consequently, the use of the badge is in accordance with and governed by the
W3C Trademark License and Logo and Icon usage policy.
Can I modify the existing icons to create my own?
No. The validator's icons are distributed under the W3C document license, which
allows distribution but does not allow derivative works.
I saw the "valid" icon displayed on a site but the page is invalid. What should I do?
We recommend that you write to the site manager and politely bring to that
person's attention that there is an inconsistency. Please note that W3C does not
verify or attempt to enforce validity claims.
http://validator.w3.org/docs/help.html
7/10
10/25/2015
For XML documents, you may also wish to include an "XML Declaration" even
before the DOCTYPE Declaration, but this is not well supported in older browsers.
More information about this can be found in the XHTML 1.0 Recommendation.
The W3C QA Activity maintains a List of recommended Doctypes that you can
choose from, and the WDG maintains a document on "Choosing a DOCTYPE".
No Character Encoding Found!
Many Flash authoring tools recommend, or enforce, the usage of the <embed>
element to include flash animations or applications in Web pages. <embed>,
however, was never part of any standardized version of HTML, and this practice
produces invalid markup.
There are many techniques to incorporate flash in valid web pages. One of the
most famous is the Flash Satay technique.
The validator complains about "&" in my URLs!
Most probably, you should read the ampersand section of WDG's excellent
"common validation problems" document.
The validator complains about something in my JavaScript!
Most probably, you should read the script section of WDG's excellent Common
HTML Validation Problems document.
Why doesn't the
http://validator.w3.org/docs/help.html
8/10
10/25/2015
Why doesn't the validator like my <link ... /> or <meta ... />?
HTML is based on SGML and uses an SGML feature (called SHORTTAG) (note
that this is not the case with XHTML).
With this feature enabled, the "/" in <link ... /> or <meta ... /> already closes the
link (or meta) tag, and the ">" becomes some regular text, which is not allowed in
the <head> element. Since </head><body> is optional in HTML (again, not in
XHTML), it is silently inserted, thus head-only elements like meta and style as well
as "</head>" and "<body>", which may appear only once, become false.
(explanation courtesy of Christoph Pper)
I found some nasty typo like <p<a ...> and the validator accepted it!
This again (as in the previous case) comes from the SHORTTAG feature in HTML
(not in XHTML). The typo is actually a "shorthand markup" and is a valid construct
in HTML, even though its use is not recommended.
/check?uri=referer does not work - or - the validator says it does not support
my "undefined" URL scheme
Browsers and other Web agents usually send information about the page they
come from, in a Referer header. The validator uses this information for a
features that allows it to validate whatever page the browser last visited. The "valid"
icons on some Web page usually point to the validation of the page using this
feature.
Unfortunately, some zealous "security software" or Web proxies strip the referrer
information from what the browser sends. Without this information the validator is
not able to find what the URL of the document to validate is, and gives the same
error message as when it is given a type of URL it does not understand.
Also, requests to non-secure HTTP resources from links in documents transferred
with a secure protocol such as HTTPS should not include referrer information per
the HTTP/1.1 specification. As the validator at validator.w3.org is currently not
available over HTTPS, this referrer feature will not work reliably for documents
transferred over secure protocols (usually https URLs) with it.
How to fix:
Check that it is indeed the Referer issue. The validator should have
redirected you to http://validator.w3.org/check?
uri=your_url_here. Otherwise, check the address you have given the
http://validator.w3.org/docs/help.html
9/10
10/25/2015
validator.
The validator cannot fix this issue. You will have to (ask your administrator to)
reconfigure whichever zealous software is stripping this referrer info.
If you have a link on your page using the "/check?uri=referer" feature, you
could replace them with the a link to the validator without this feature, e.g.
http://validator.w3.org/check?
uri=https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fwww.example.com
If you have no control over the page or annoying software, or your page's URL
is a https one, simply append the address of the page you wanted validated
(URI encoded) to the http://validator.w3.org/check?uri= address.
Home
About...
News
Docs
Feedback
Contribute
http://validator.w3.org/docs/help.html
10/10