If you've ever created an <ul> and have a number of <li>s in it, and the last one either is cut-off, shows up in two places, spaced rather big vertically or is somehow 'messed up' and adding another <li> makes the previous one 'okay' and the last one added messed up..., -'white-space bug'.
Originally Posted by AmazingAnt
In a nutshell, in an <ul>, IE sometime incorrectly sees a 'line break' in your HTML code as a "virtual carriage return" (to borrow the typing expression), and it inserts a 'virtual <br />' there... totally messin' up your code.
<ul><li><a href="#">One</a></li><li><a href="#">Two</li><li><a href="#">Three</a></li></ul>
and the output is a list like:
above is 'white-space bug-free', whereas:
triggers the 'white-space bug' and the output is:
Ways to combat this are to declare "display:inline-block;", set a default width for the <li>, use "<--" after <"/li>" and "-->" before "<li>", -there are other methods but either of these is sufficient.
This will explain it further and probably better:
Last edited by WebJoel; 03-10-2007 at 01:51 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)