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

CSS

Navigation 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; } }

Could you put the working code into a jsfiddle and post the link so I can see whats happening please?

First time to use Jsfiddle but i hope i made it right thanks http://jsfiddle.net/zulucoding/8a4mq/

Yeah from looking at the fiddle. I agree with Matt from below. You did the fiddle perfect thou mate!

Thank you very much..

1 Answer

Your media query isn't removing the margin on #navigation so there's going to be a 20px margin all around #navigation?

Matthew , Thank you very much