I know… this one is shocking. After all, doesn’t the validator use the
Browsers are much more compliant than you think
One of the persistent complaints about various Web browsers (usually Internet Explorer) is that, because they are not fully compliant with the HTML spec, they render things very differently. The reality is, browsers are much more compliant with the HTML spec than you think. And those obnoxious variances in rendering? The HTML spec is generally silent as to how things should render in a Web browser. There are some “should” and some “should not” items regarding rendering in the spec. But chances are, if one browser doesn’t do what you expect it to, if you check the HTML spec, it is probably silent on the matter. Those differences in error handling and how invalid HTML is dealt with? Again, the current HTML spec is pretty quiet about those things. Blame HTML 4, not the browser. Luckily, HTML 5 is much more specific on these points, which should alleviate much of the differences between browsers.
Compliance does less than you think
The other side of the compliancy coin is that a browser’s compliance with the HTML specification is little guarantee that your document will display the way you expect it to. Because so much of the current HTML specification is worded with “should” and some “should not” (as opposed to “must” and “must not”), browser vendors have a lot of leeway in how things are done, while still remaining compliant with the spec. Again, HTML 5 is working hard to make these things more clear and to reduce these kinds of issues.
Validators cannot cover all of the bases
Another favorite tool of many Web developers is the trusty HTML validator. What many programmers don’t realize is that aspects of the specification are not machine verifiable! In most cases, the validators can work, but in some they cannot. There are a number of instances in the specifications where whether something is allowed is based on circumstances that a computer just is not well suited to detecting. So, yes, keep using your validator, but be sure to check your code against the specification too when possible.
The
tag
Thetag is supposed to be used for an inline block of text that represents quotes. An analogy is: “is toasis to .” For a number of reasons,is not widely used. When quotations are marked up with HTML, it is usually with the much more populartag. So what is so strange about? As a tag, it is supposed to do something that no other tag does: It is supposed to automatically surround its contents with quotation marks. This behavior is not well specified in HTML 4, and Internet Explorer never implemented it. As a result, authors who usedhave traditionally put in browser detection to add the quotation marks in Internet Explorer. In Internet Explorer 8, its behavior will be updated to comply with the spec as well. While this is good overall, it will break the code with browser detection. While the idea of a tag adding punctuation may be unusual (as far as I know,is the only tag that does it), the authors currently usingknow enough to expect it.
This is just a sampling of some of the oddities in HTML that I have found. I hope that you find this information useful!
No comments:
Post a Comment