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
Bahi Hussien
Courses Plus Student 13,128 PointsNavigation menu left margin issue
In normal width it works fine, but when it comes to smaller screens margin on left appears here is my code
Jsfiddle link: http://jsfiddle.net/zulucoding/8a4mq/
navigation
{ width:100%; margin: 20px; list-style: none; }
navigation li
{ display:inline; padding:10px; margin-bottom:5px;
}
navigation a
{ text-decoration:none; color:#EDEDED; }
navigation a:hover
{ color:#BDBDBD; }
@media (max-width: 600px) {
#navigation { width:100%; background-color:#09F; list-style:none; }
#navigation li { width:100%; margin:0; display:block; text-align:center; } }
Bahi Hussien
Courses Plus Student 13,128 PointsFirst time to use Jsfiddle but i hope i made it right thanks http://jsfiddle.net/zulucoding/8a4mq/
Adam Sackfield
Courses Plus Student 19,663 PointsYeah from looking at the fiddle. I agree with Matt from below. You did the fiddle perfect thou mate!
Bahi Hussien
Courses Plus Student 13,128 PointsThank you very much..
1 Answer
Matt Campbell
9,767 PointsYour media query isn't removing the margin on #navigation so there's going to be a 20px margin all around #navigation?
Bahi Hussien
Courses Plus Student 13,128 PointsMatthew , Thank you very much
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsCould you put the working code into a jsfiddle and post the link so I can see whats happening please?