I've been using the Markup Validation Service provided by the World Wide Web Consortium (W3C) to check for errors in the HTML code for webpages on this site, but recently came across another such free service, the Free HTML & CSS Validation Service at OnlineWebCheck.com. Like the W3C service, you can provide a URL for your website to be analyzed for HTML errors. The service will display any errors found on a submitted page and warnings for page elements that aren't errors, but which may deserve closer scrutiny. The online service is free and allows you to check URLs one-by-one. The service uses CSE HTML Validator Pro, which is software that runs on Microsoft Windows systems, or Linux and Mac OSX with Wine. There is a free version of that software available for download as well as paid versions with more features - see Compare CSE HTML Validator Editions. I haven't yet tried that software on a Microsoft Windows system yet, though, but have only used the online validation service.
I found the service yesterday when the W3C service wasn't responding. One warning I received for a submitted page was for the lack of a language specification within the <HTML> start tag. The warning was:
The natural primary language is not specified. It is highly recommended that the "lang" and/or "xml:lang" (for XHTML) attributes be used with the "html" element to specify the primary language. For example, add the attribute lang="en" for English or lang="fr" for French. Specifying the language assists braille translation software, speech synthesizers, translation software, and has other benefits.
<html>
I had been including the following within the <head> section:
<meta name="language" content="english">
The OnlneWebCheck.com validator noted in regards to it, though:
Remove this meta tag and use the "lang" attribute on the "html" element if trying to specify the document's language, or use a "dcterms.language" meta tag instead. Furthermore, "language" is not a recognized metadata name. Visit http://www.w3.org/TR/html5/document-metadata.html#standard-metadata-names and http://wiki.whatwg.org/wiki/MetaExtensions for more information.
<meta name="language" content="english">
Though the W3C validation service had never issued any warnings nor errors related to the lack of inclusion of the language attribute within the <HTML> tag or use of the meta tag, at the W3C site at Specifying the language of content: the lang attribute webpage, I found:
Language information specified via the lang attribute may be used by a user agent to control rendering in a variety of ways. Some situations where author-supplied language information may be helpful include:
- Assisting search engines
- Assisting speech synthesizers
- Helping a user agent select glyph variants for high quality typography
- Helping a user agent choose a set of quotation marks
- Helping a user agent make decisions about hyphenation, ligatures, and spacing
- Assisting spell checkers and grammar checkers
The recommendation made for assisting search engines and browsers to determine the language for webpages is to include the language attribute within the <html> tag as shown below:
<html lang="en">
...
</html>
Or for XHTML:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
...
</html>
So, I decided to modify the template that I use for pages to include the
language attribute within the <html> tag, i.e., to use
<html lang="en">
, and to include the attribute within
the <html> tag for Blosxom's head.html
file.
If a page is in another language than English, the appropriate code can be chosen from the ISO 639-1 two-letter language codes. ISO 639-1 defines abbreviations for languages. In HTML and XHTML they can be used in the lang and xml:lang attributes.