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 trialDouglas Dunn
8,937 PointsHow to set the left padding to 0? This is for the selector nav ul
it asks to remove the padding on the unordered list and I get an error saying did you set the left padding to 0?
a {
text-decoration: none;
}
#wrapper {
max-width: 940px;
margin: 0 auto;
}
#logo {
text-align: center;
margin: 0;
}
h1, h2 {
color: #fff;
}
nav ul {
list-style: none;
margin: 0 10px;
padding 0;
}
nav a {
color: #fff;
}
nav a:hover {
color: #32673f;
}
h1 {
font-family: βChanga Oneβ, sans-serif;
font-size: 1.75em;
font-weight: normal;
}
img {
max-width: 100%;
}
#gallery {
margin: 0;
padding: 0;
list-style: none;
}
#gallery li {
float: left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
3 Answers
Bryce Santos
11,157 Pointsnav ul {
list-style: none;
margin: 0 10px;
padding-left: 0;
}
Grady Taylor
3,897 PointsIf it's asking you to remove the padding then simply erase the padding property and its value.
For applying padding specifically to the left use the 'padding-left' property.
Jason Anders
Treehouse Moderator 145,860 PointsHey Grady,
Just removing the padding property is not a good idea and will often not work for a few reasons.
All browsers have default CSS settings that are applied if there are none set by a CSS file. Hence, if you just remove the padding rule, the browser could add it's own default setting.
If you are using any sort of CSS reset or Normalize, and you remove the rule, you risk it defaulting to the one in the reset.
If you have set the rule somewhere else in your style sheet (or another style sheet), it will just default back to that one.
So, if you truly want the left margin to be Zero, then you do have to write a rule and set its value to 0.
Grady Taylor
3,897 PointsHey Jason
Thanks you for your response.
Those are all very valid points, I'll keep them in mind for the future, especially when using descendant selectors!
Thanks again.
Douglas Dunn
8,937 PointsI figured out my problem. I just forgot a colon after padding. padding: 0 Thanks anyway guys!
Bryce Santos
11,157 PointsNo problem! Glad you found the solution.