On 04/23/2010 05:26 PM, Eric Brine wrote:
On Fri, Apr 23, 2010 at 5:04 PM, Shlomi Fish<shlo...@iglu.org.il> wrote:
I'm not sure even HTML 4.0 still allows stray opening tags (such as<p> or
<td> or
whatever).
"stray"? It most definitely allows the end tag to be omitted for certain
elements. (Of those elements, I used P, LI, TBODY, TR and TD) . It even
allows the opening tags of certain elements to be omitted. (Those elements
are HTML, HEAD, BODY, TBODY and no other.)
Allow, but not necessarily recommend or advocate. Closing tags gives the
processor more explicit instructions on how to deal with ambiguities,
and let's the code be checked for good form. I close all my tags as a
matter of principle. Unless there is some harm in doing so - I think it
is a good practice.
> In fact, I couldn't make it make it compliant with both HTML and XHTML
because I used HR.
What is HR in this context?
The HR element.
Valid Valid
HTML XHTML
--------- ----- -----
<hr> yes no
<hr/> no yes
<hr></hr> no yes
The combined open close tags such as <hr/> should be used with a space
before the / to make sure it works on old and new browsers.
Try: <hr />
Again, it's just a good practice.
Cheers,
mark