PDA

View Full Version : Padding-top problem.



w1sh
May 28th, 2008, 12:39 PM
http://webs.ashlandctc.org/csimmons/sites/actctlc/pages/index_beta2.htm

Trying to redesign this site because it was hideous..

Any idea why when I add "padding-top:5px;" to #links it spaces my next div??

ahmednuaman
May 28th, 2008, 01:03 PM
Have you added margin: 0?

w1sh
May 28th, 2008, 01:04 PM
Of course :)
Here is the css
http://webs.ashlandctc.org/csimmons/sites/actctlc/pages/tlccss2.css

fasterthanlight™
May 28th, 2008, 01:05 PM
your unordered list has default styling, ie: big margins and padding

that is why




#links ul {
margin: 0;
padding: 0;
}
ALSO

since your #links has a defined height of 28px to match the background image, any padding you add, adds to the height.... rewrite it as 23px if you add 5px top padding.

w1sh
May 28th, 2008, 01:11 PM
your unordered list has default styling, ie: big margins and padding

that is why




#links ul {
margin: 0;
padding: 0;
}
ALSO

since your #links has a defined height of 28px to match the background image, any padding you add, adds to the height.... rewrite it as 23px if you add 5px top padding.

The list was just some crap I was fooling around with. I should really stop posting links to stuff I'm in the middle of working on and start posting code within the thread.

However, the latter point was dead on. Thank you so much. :D

fasterthanlight™
May 28th, 2008, 01:15 PM
Hahah yea, i wrote the second part after i figured out that the real problem was the padding/height thing...

but your unordered list will still break it i think if you don't reset its margins

w1sh
May 28th, 2008, 03:05 PM
Hahah yea, i wrote the second part after i figured out that the real problem was the padding/height thing...

but your unordered list will still break it i think if you don't reset its margins

Even if I don't use them now, I'll remember that.
You just saved the forum another question from me. :)

fasterthanlight™
May 28th, 2008, 03:21 PM
Note: that only really applies to a div that has a height setting.

w1sh
May 29th, 2008, 10:43 AM
Ah, this little tidbit has already helped me several times.