Differences between HTML and XHTML have been noted. Differences between HTML 4.01 and HTML 5 less so. The following identifies one difference that may seem insignificant but annoys me endlessly.
[Note: The following adressess HTML 5; not XHTML 5. All HTML 4.01 text/html and XHTML 1.0 text/html documents are considered to be HTML 5.[1]]
HTML 4.01 Specification, 7.4.4 Meta data states,
The http-equiv attribute can be used in place of the name attribute and has a special significance when documents are retrieved via the Hypertext Transfer Protocol (HTTP). HTTP servers may use the property name specified by the http-equiv attribute to create an [RFC822]-style header in the HTTP response. Please see the HTTP specification ([RFC2616]) for details on valid HTTP headers.
[Note: W3C specifications do not place use limitations.]
HTML 4.01 Specification, 5.2.2 Specifying the character encoding states,
META declarations should appear as early as possible in the HEAD element.
Whereas,
Web Applications 1.0 allows one (1) http-equiv: character set. And, it must be placed first in the <head> section.
Web Applications 1.0, 3. Semantics and structure of HTML elements, 3.8. Document metadata, 3.8.5. The meta element offers,
- Metadata element
- Contexts in which this element may be used:
- In a
headelement.- Content model:
- Empty.
- Element-specific attributes:
- name
http-equiv(HTML only, optional [Elementary emphasis.])- content
- Predefined classes that apply to this element:
- None.
- DOM interface:
interface HTMLMetaElement : HTMLElement {attribute DOMString content;attribute DOMString name;};
This site failed (X)HTML5 Conformance Checking Service for numerous requirements but the particular error was,
-
Error: The element
metawith the attributehttp-equivis not allowed at this point. The attributehttp-equivis only appropriate for declaring the character encoding and in that case the element must be the first element child of theheadelement.Line 10, column 45 in resource http://www.elementary-group-standards.com/
Henri Sivonen kindly suggested that I read further down. I did.
3.8.5.3. Specifying and establishing the document’s character encoding
The
meta element may also be used, in HTML only (not in XHTML) to provide UAs with character encoding information for the file. To do this, the meta element must be the first element in the head element, it must have the http-equiv attribute set to the literal value Content-Type, and must have the content attribute set to the literal value text/html; charset= immediately followed by the character encoding, which must be a valid character encoding name. [IANACHARSET] When the meta element is used in this way, there must be no other attributes set on the element, and the http-equiv attribute must be listed first in the source. Other than for giving the document's character encoding in this way, the http-equiv attribute must not be used. [Elementary emphasis]
I had missed that. Or, not remembered.
The actual code which failed was,
<meta http-equiv="imagetoolbar" content="no">
The IE Image Tool Bar fix has been deprecated by HTML 5.
This site would have simple fixes. It would be to place the few images as CSS background-image. I am more concerned about about commerce sites. The simple fix has been <meta http-equiv="imagetoolbar" content="no"> but I doubt HTML5 shall allow it. I Googled for PHP or Java Script code which could replace the ubiquitous Imagetoolbar fix but I did not find any that were concise or suitable.
Does anyone know any IE Image Tool Bar blocking scripts?
- Web Applications 1.0, 1.4.1. HTML vs XHTML states,
There are various concrete syntaxes that can be used to transmit resources that use this abstract language, two of which are defined in this specification.
The first such concrete syntax is
HTML5
. This is the format recommended for most authors. It is compatible with all legacy Web browsers. If a document is transmitted with the MIME typetext/html, then it will be processed as anHTML5
document by Web browsers.The second concrete syntax uses XML, and is known as
XHTML5
. When a document is transmitted with an XML MIME type, such asapplication/xhtml+xml, then it is processed by an XML processor by Web browsers, and treated as anXHTML5
document. Generally speaking, authors are discouraged from trying to use XML on the Web, because XML has much stricter syntax rules than theHTML5
variant described above, and is relatively newer and therefore less mature.
[Published date: 3 March 2007]

