[thelist] Why do we say what we say?

Stephen Rider evolt_org at striderweb.com
Thu Oct 25 11:23:28 CDT 2007


On Oct 25, 2007, at 8:28 AM, cj wrote:

> On 10/25/07, Rick den Haan <rick.denhaan at gmail.com> wrote:
>> Something else that the validator will happily ignore is code  
>> indentation.
>> ... Other
>> developers tend to close their elements after the indentation, e.g.:
>>
>> <ul
>>> <li>Item 1</li
>>> <li>Item 2</li
>>> </ul>
>>
>> I never saw the point in that, but I'm told it could get rid of some
>> unwanted space in some browsers.

Some versions of IE has issues with that.  HTML is supposed to ignore  
whitespace, but < IE6 (?) does not.

I use this, and it has fixed the problem for me:

<ul>
	<li>Item 1</li>
	<li>Item 2</li></ul>

Though it can be annoying when rearranging a list.  IE annoying?  You  
don't say!


Regarding spaces in self-closing elements such as <br />, my  
understanding is this:

Officially, HTML rendering is supposed to ignore attributes it  
doesn't understand.  br is a legitimate tag, but br/ is not.  Thus,  
<br/> is illegitimate HTML tag, while <br /> is a legitimate HTML tag  
with an unknown "/" attribute.  IN THEORY, an html renderer should no  
more understand <br/> than it understands <blearg>.

So they stuck the space into the XHTML spec specifically for  
backwards compatibility with HTML.

Stephen Rider



More information about the thelist mailing list