Web Hosting Talk







View Full Version : Reducing space between a <ul> and the text before it


reddem0n
03-19-2010, 10:06 PM
Just like the topic says. I'm trying to see how I can reduce the space between the text before the <ul> tag. There's a huge gap and I'd like to reduce it.

campolar
03-20-2010, 08:48 AM
in the css, add margin to both the orignal text (like if its inside a p) and the ul.

Margins work like this:
[code]
margin: 0 0 0 0;
[code]
And they work clock wise so its margin: top right bottom left.

Add those the the P and UL classes in CSS and you'll learn your way through it :)

sgarbus
03-20-2010, 10:27 AM
Here are the tags you'll need to modify in your stylesheet... if you just paste these in (assuming you don't already have these specified), it should clear up the space like you're trying to do.

ul {
margin: 0;
padding: 0;
}

li {
list-style-type:circle;
margin:0px 0px 5px 0px;
padding:0;
}

p {
margin:0;
padding:0
}

If you have a heading (h1, h2, h3, etc) above the <ul> tag causing the spacing, you'll need to play with the margin on those tags.

margin: 0px 0px 0px 0px;
(As campolar stated, it goes as follows: top right bottom left) -- if a value is 0, you don't need to define 'px' after it.

dennisthompson
03-20-2010, 07:13 PM
Here are the tags you'll need to modify in your stylesheet... if you just paste these in (assuming you don't already have these specified), it should clear up the space like you're trying to do.

ul {
margin: 0;
padding: 0;
}

li {
list-style-type:circle;
margin:0px 0px 5px 0px;
padding:0;
}

p {
margin:0;
padding:0
}

If you have a heading (h1, h2, h3, etc) above the <ul> tag causing the spacing, you'll need to play with the margin on those tags.

margin: 0px 0px 0px 0px;
(As campolar stated, it goes as follows: top right bottom left) -- if a value is 0, you don't need to define 'px' after it.

Or there are multiple types of list types. Circle is one and the usual default is disc.

But you can just use margin:0px;

reddem0n
03-22-2010, 08:01 PM
Thanks guys. I'll give it a try tomorrow and see what happens.

jakethefake
03-23-2010, 06:36 AM
If that doesn't work, try

ul {
margin-top: -10px;
padding: 0;
}