spacing with the UL tag
Posted: 01 December 2008 04:11 PM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2008-12-01

Hello,

When using the list tag, <ul>, it creates a space between the line before and line afterwards. Anyone know how to get rid of this?  For example:

Following are my favorite links
* Site a
* Site b

When I translate this into html, it looks like:

Following are my favorite links

* Site a
* Site b

The code is:
<p >Following are my favorite links </p ><ul>
<li>Site a</li>
<li>Site b</li>
</ul>

If I take the <ul> out completely, the space between the paragraph and the bullets goes away - but then it’s not “correct code” for WC3, etc.

Any style sheet ideas to get what I want?

Thanks in advance.
D—

Profile
 
 
Posted: 05 December 2008 02:59 PM   [ Ignore ]   [ # 1 ]
Newbie
Avatar
Rank
Total Posts:  10
Joined  2008-11-14

The p and ul tags have default spacing in most browsers, so just use a CSS reset which will get rid of default browser margins and padding for the p and ul tags, then specify your own style for them.

Reset exmple:

divpulli {margin:0;padding:0;

More on CSS reset

Hope that helped.

Profile
 
 
Posted: 05 December 2008 03:50 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  2
Joined  2008-12-01

Yeah!  Thank you. It worked.  Since I only had it in one place, here was my solution:

<p style=“margin: 0px; padding: 0px”> Following are my favorite sites:</p><ul style=“margin: 0px 0px 5px 10px; padding: 0px 0px 5px 10px” >
          <li>[url=“http://www.sitea.com” target=“_blank”]
            Site A[/url]</li>       
          <li>Site B</li>
        </ul>

Profile
 
 
Posted: 15 December 2010 12:40 AM   [ Ignore ]   [ # 3 ]
Jr. Member
RankRank
Total Posts:  42
Joined  2010-12-14

It’s really easy in css3,try it.

Profile