Using CSS With No HTML At All
css-tricks.com
css-tricks.com
This caught me totally off guard. My experience has been that XHTML is much easier to manage across browsers than HTML 4. Can anyone chime in as to whether I'm crazy?
I don't see why XHTML would be any easier to manage than well-formed HTML, provided you trigger standards mode and the right IE-compatibility modes.
I used XHTML for a short while before I learned what it actually meant. Then I switched to HTML4.01, now HTML5. The nice thing about HTML5 is that it let's you have any syntax you want and it is not based neither on SGML nor XML.
This post by hixie indicates that self-closing tags are allowed to 'ease migration': http://lists.whatwg.org/pipermail/help-whatwg.org/2008-Augus...
I believe the 'spirit' of the spec would imply that <br> is the best practice when writing new markup. HTML5 maintains no pretence of being XML.
If you try to validate document using xhtml markup as html you may get this warning from validator:
NET-enabling start-tag requires SHORTTAG YES
The sequence <FOO /> can be interpreted in at least two different
ways, depending on the DOCTYPE of the document. For HTML 4.01
Strict, the '/' terminates the tag <FOO (with an implied '>').
However, since many browsers don't interpret it this way, even
in the presence of an HTML 4.01 Strict DOCTYPE, it is best to
avoid it completely in pure HTML documents and reserve its use
solely for those written in XHTML.
In XML (and hence XHTML) with the help of some mind-boggling trickery (Web SGML Adaptations Annex) you can have things like <foo/>This obviously does take some effort to get right, and for most people may not be worth the trouble. W3C has some info on this practice here:
http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-a...