W3C home > Mailing lists > Public > www-style@w3.org > August 1998

Re: Lists

From: Russell Grigaitis <russell.grigaitis@pre-print.com>
Date: Tue, 25 Aug 1998 08:57:45 -0600
Message-ID: <003201bdd038$bdfcf6e0$aaa0a8c0@russellg.pre-print.com>
To: <www-style@w3.org>
>just a quick question. I'm designing a page with CSS and I've used a
>Unordered List with about four list items. But i don't like the fact that
it
>takes a blank line before the list starts and there's a blank line before
>the next para starts.


This should be the way to do it:

UL

  margin-top: 0pt;
  margin-bottom: 0pt;
  }

This works in IE4, but NS4 still put in the line spaces.

For this to work your Unordered List must be in the paragraph:

<P>Before
<UL>
    <LI>One</LI>
    <LI>Two</LI>
    <LI>Three</LI>
</UL>(you may want to start here to kill the character space)
After</P>

If it is not in the paragraph, you must change the margins of the paragraph
as well:

UL

  margin-top: 0pt;
  margin-bottom: 0pt;
  }

P.beforeUL

  margin-bottom: 0pt;
  }

P.afterUL

  margin-top: 0pt;
  }

...

<P class="beforeUL">Before</P>
<UL>
    <LI>One</LI>
    <LI>Two</LI>
    <LI>Three</LI>
</UL>
<P class="afterUL">After</P>



___________________________________________________________
Russell Grigaitis
Pre Print Incorporated
200, 12420 - 104 Avenue
Edmonton, AB  T5N 3Z9
(403) 488 - 6688
http://www.pre-print.com
Received on Tuesday, 25 August 1998 10:54:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:55 GMT