Re: HTML 4.01 and 5.0: is it somewhat "unspecific" about space characters

Anne van Kesteren wrote:
> On Sun, 30 Mar 2008 09:09:33 -0700, Kenneth Kin Lum  
> <kenneth.kin.lum@gmail.com> wrote:
>> hm... so you mean HTML take all spaces to be the content... and then...  
>> it is CSS that decides to drop them?
> 
> CSS can't change content. They're just not rendered by default based on  
> the white-space property value.

My favourite is this one:

  <ul>
   <li><a href...>Foo</li>
   <li><a href...>Bar</li>
   <li><a href...>Baz</li>
  </ul>

Now, there's no way to get the list items to butt up against each other. For
example, if you intend for this:

  [ Foo ][ Bar ][ Baz ]

The white space will give:

  [ Foo ] [ Bar ] [ Baz ]

Although all white space between <li>s will normally be dropped, if you set
li { display: inline } to get them in a horizontal line, now you'll get
exactly one space between each. The spaces between </li> and <li> will
collapse to a single, visible space.

Received on Sunday, 30 March 2008 16:35:00 UTC