Re: Space between listitems

Giganews Newsgroups
Subject: Re: Space between listitems
Posted by:  dorayme (doraymeRidTh…@optusnet.com.au)
Date: Tue, 17 Jun 2008

In article
<6013dd0c-6694-4570-9883-d20ab95f8a…@s50g2000hsb.googlegroups.com>,
Veerle <veerlever…@hotmail.com> wrote:

> Hi,
>
> I have a list:
> <ul>
>    <li>Li 1 - blablablablabla</div>
>    <li>Li 2 - blablablablabla</div>
>    <li>Li 3 - blablablablabla</div>
>    <li>Li 4 - blablablablabla</div>
>    <li>Li 5 - blablablablabla</div>
> </ul>
> When I change the style to:
>    ul { margin: 0px; padding: 0px; }
>    li { margin: 0px; padding: 0px; font-family:Arial,Helvetica,sans-
> serif; font-size:12px; }
> in IE7 there is still some space between the list items.
>
> If I do the same thing with divs:
> <div>Div 1 - blablablablabla</div>
> <div>Div 2 - blablablablabla</div>
> <div>Div 3 - blablablablabla</div>
> <div>Div 4 - blablablablabla</div>
> <div>Div 5 - blablablablabla</div>
> With style:
> div { margin: 0px; padding: 0px; font-family:Arial,Helvetica,sans-
> serif; font-size:12px; }
> Then the items are much closer to one another than with the list (in
> IE7).
>
> How can I change the css of the listitems or the list so that these
> items are as close to one another as with the divs in IE7?

A URL would help on this.

I hope your end tags on the list above are typos just in this post.

It is sometimes necessary to remove whitespace or carriage returns
between closing list tag and opening next. You can still be rasonably
tidy in your source by something like:

<ul>
<li>Li 1 - blablablablabla</li><
li>Li 2 - blablablablabla</li><
li>Li 3 - blablablablabla</li><
li>Li 4 - blablablablabla...

where the carriage returns do not affect things.

--
dorayme

Replies

In response to

Space between listitems posted by Veerle on Mon, 16 Jun 2008