Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Html Tags > Re: Closed empt...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 395 of 439
Post > Topic >>

Re: Closed empty elements in html 4.01 strict

by "Jukka K. Korpela" <jkorpela@[EMAIL PROTECTED] > Feb 1, 2006 at 08:09 PM

Gazza <news@[EMAIL PROTECTED]
> wrote:
 
> chromatic_aberration mumbled the following on 01/02/2006 13:43:
>> I "discovered" some time ago, that closing <br> and <img [...]>
>> tags (i.e. <br /> and <img [...] />) in an HTML 4.01 Strict
>> document, actually *validates* on the W3C markup validator...
- -
> The browsers, and in this case, the validation script see the "/"
> as just another attribute.

No, the wowsers just skip it since they don't understand it.
A validator does something completely different: "/" terminates a tag, 
and the following ">" is treated as character data. For a more detailed 
explanation, see http://www.cs.tut.fi/~jkorpela/html/empty.html

> Technically XHTML shouldn't have a space before the /
> e.g. <br/>

Technically it should, according to the (in)famous Appendix C.

> but then the parser doesn't know an element called
> "br/".

The point is that some wowsers choke on it.

> It doesn't hurt to have these close these empty elements, but it
> would be best to either use an XHTML DTD, or stick with /plain/
> HTML. 

Sorry, but that does not make much sense.

XHTML is not suitable for delivery of content on the WWW. Simple as 
that. If you have some pseudo-religious reason to use it, you need to 
play by Appendix C rules so that it looks like HTML as much as 
possible.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html




 6 Posts in Topic:
Closed empty elements in html 4.01 strict
chromatic_aberration <  2006-02-01 14:43:24 
Re: Closed empty elements in html 4.01 strict
Gazza <news@[EMAIL PRO  2006-02-01 14:37:39 
Re: Closed empty elements in html 4.01 strict
chromatic_aberration <  2006-02-01 19:23:13 
Re: Closed empty elements in html 4.01 strict
Gazza <news@[EMAIL PRO  2006-02-01 18:40:17 
Re: Closed empty elements in html 4.01 strict
"Jukka K. Korpela&qu  2006-02-01 20:09:43 
Re: Closed empty elements in html 4.01 strict
David Dorward <dorward  2006-02-01 20:00:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 1:28:48 CDT 2008.