Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Adam Ridgley](https://uploads.teamtreehouse.com/production/profile-photos/1219942/micro_70508048_10220167490522905_7097376574093131776_n.jpg)
Adam Ridgley
12,255 PointsCSS Margin issue
Hello,
I have a small issue with my CSS margins, I have a section element within a wrapper div and I am trying to move the section element down from the top of the wrapper, but everytime I apply margin to the margin top of the section, it pushes the wrapper away from the top of the page?
The markup is as follows:
#wrapper {
max-width:960px;
margin:0 auto;
border-left:1px solid #ccc;
border-right:1px solid #ccc;
background:#fff;
padding-bottom:30px;
}
#list {
margin:2.5%;
width:95%;
}
The list section is in the wrapper, but the 2.5% margin is pushing the wrapper down from the top of the screen, I'm not sure what I'm doing wrong.
Any ideas?
Thanks!
Adam
5 Answers
![Eric Dietrich](https://secure.gravatar.com/avatar/f3f615c738ac415e187de9590b685f9a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Eric Dietrich
Courses Plus Student 5,897 PointsIf you are wanting to move the section "down" in the element, use
padding-top: 2.5%
![idan ben yair](https://uploads.teamtreehouse.com/production/profile-photos/1178562/micro_idan.jpg)
idan ben yair
10,288 Pointstry to define margin-top: 2.5%;
![Adam Ridgley](https://uploads.teamtreehouse.com/production/profile-photos/1219942/micro_70508048_10220167490522905_7097376574093131776_n.jpg)
Adam Ridgley
12,255 PointsPadding works, no luck with the margin-top though :(
Probably missing something but I don't know haha
Thanks for the help!
![idan ben yair](https://uploads.teamtreehouse.com/production/profile-photos/1178562/micro_idan.jpg)
idan ben yair
10,288 Pointslol happens.. I see you defined max-width in pixels for the wrapper and the margin in % for the list. I had bad experiences with that.. usually I just either do only % or pixels..
![Adam Ridgley](https://uploads.teamtreehouse.com/production/profile-photos/1219942/micro_70508048_10220167490522905_7097376574093131776_n.jpg)
Adam Ridgley
12,255 PointsSuppose I could convert it, thanks for the tip :)
![idan ben yair](https://uploads.teamtreehouse.com/production/profile-photos/1178562/micro_idan.jpg)
idan ben yair
10,288 PointsGood luck! :)