|
Posted by Toby Inkster on 07/18/06 18:50
Michael Laplante wrote:
> Okay, I'm a little fuzzy on the differences between XHTML and HTML spec 4
> and above.
The only real difference is that XHTML has to obey XML rules, whereas HTML
doesn't. The places it manifests itself are:
1. All elements must be explicitly closed. In HTML some elements have an
optional closing tag (e.g. <p>, <li>) and some elements must never have a
closing tag (e.g. <meta>, <hr>). In XHTML, the closing tags are required.
Optionally, you can compact the opening and closing tags into one tag
(e.g. "<br></br>" crunches down to "<br/>") -- this may improve browser
support.
2. Element and attribute names are case-sensitive. That is, <p> and <P>
are completely different tags -- XHTML uses lower-case for all element and
attribute names, but attribute values still follow HTML rules, as they're
completely consistent with XML syntax.
3. Under HTML there are certain circumstances where attribute values don't
need quoting. Under XHTML, they always need quoting.
There are other minor differences, the full list is here:
http://www.w3.org/TR/xhtml1/#diffs
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
[Back to original message]
|