Reply to Re: The natural space between inline list items?

Your name:

Reply:


Posted by Jukka K. Korpela on 06/19/06 07:28

Els <els.aNOSPAM@tiscali.nl> scripsit:

> Not sure if this is what you are looking for, but if you write the
> list without space or newline between the list items, like so:
> <ul><li>Item1</li><li>Item2</li><li>Item3</li></ul>, the visual space
> between the items will also disappear.

This is known as white space bug in browsers: if you have a line break
between, say, </li> and <li>, they incorrectly treat the line break as
equivalent to a space. By HTML (SGML) rules, a line break shall be ignored
in such a context. Worse still, browsers treat the space they construct as
appearing inside the li element, as if you had
<ul><li>Item1 </li><li>Item2 </li><li>Item3 </li></ul>
(This is all wrong, since whitespace between elements should be ignored.)

There's probably little hope of having the bug ever fixed in popular
browsers, so it is best to use the suggested compact notation in problematic
cases.

> Then, with margin-left/right, you can set the exact space you like.

With the usual CSS caveats, yes.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация