# Padding-top problem

**URL:** <https://forum.kirupa.com/t/padding-top-problem/261531>\
**Category:** Uncategorized\
**Created:** [May 28, 2008, 3:39pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531 "2008-05-28T15:39:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![w1sh](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@w1sh](https://forum.kirupa.com/u/w1sh)\
**Post date:** [May 28, 2008, 3:39pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/1 "2008-05-28T15:39:49Z")

</div>

[http://webs.ashlandctc.org/csimmons/sites/actctlc/pages/index\_beta2.htm](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??

---

<div class="post-metadata">

**Author:** ![w1sh](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@w1sh](https://forum.kirupa.com/u/w1sh)\
**Post date:** [May 28, 2008, 4:04pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/2 "2008-05-28T16:04:32Z")

</div>

Of course 🙂  
Here is the css  
[http://webs.ashlandctc.org/csimmons/sites/actctlc/pages/tlccss2.css](http://webs.ashlandctc.org/csimmons/sites/actctlc/pages/tlccss2.css)

---

<div class="post-metadata">

**Author:** ![fasterthanlight](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fasterthanlight](https://forum.kirupa.com/u/fasterthanlight)\
**Post date:** [May 28, 2008, 4:05pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/3 "2008-05-28T16:05:50Z")

</div>

your unordered list has default styling, ie: big margins and padding

that is why

```auto

#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.

---

<div class="post-metadata">

**Author:** ![w1sh](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@w1sh](https://forum.kirupa.com/u/w1sh)\
**Post date:** [May 28, 2008, 4:11pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/4 "2008-05-28T16:11:18Z")

</div>

[quote=fasterthanlight™;2332405]your unordered list has default styling, ie: big margins and padding

that is why

```auto

#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.[/quote]

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. 😃

---

<div class="post-metadata">

**Author:** ![fasterthanlight](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fasterthanlight](https://forum.kirupa.com/u/fasterthanlight)\
**Post date:** [May 28, 2008, 4:15pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/5 "2008-05-28T16:15:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![w1sh](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@w1sh](https://forum.kirupa.com/u/w1sh)\
**Post date:** [May 28, 2008, 6:05pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/6 "2008-05-28T18:05:31Z")

</div>

[quote=fasterthanlight™;2332410]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[/quote]

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

---

<div class="post-metadata">

**Author:** ![fasterthanlight](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fasterthanlight](https://forum.kirupa.com/u/fasterthanlight)\
**Post date:** [May 28, 2008, 6:21pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/7 "2008-05-28T18:21:54Z")

</div>

Note: that only really applies to a div that has a height setting.

---

<div class="post-metadata">

**Author:** ![w1sh](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@w1sh](https://forum.kirupa.com/u/w1sh)\
**Post date:** [May 29, 2008, 1:43pm UTC](https://forum.kirupa.com/t/padding-top-problem/261531/8 "2008-05-29T13:43:50Z")

</div>

Ah, this little tidbit has already helped me several times.
