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 jQuery Basics (2014) Creating a Mobile Drop Down Menu Perfect

CRYSTAL YONG
CRYSTAL YONG
1,523 Points

There is a problem with my mobile menu.

The #menu ul {display: none; } does not seem to be disappearing when I decrease the screen size.

CRYSTAL YONG
CRYSTAL YONG
1,523 Points

Yes, I have already applied it.

@media (min-width: 320px) and (max-width: 568px) { #menu ul { display: none; } }

@media (min-width: 568px) { #menu select, #menu button { display: none; } }

2 Answers

sboussacsou
PLUS
sboussacsou
Courses Plus Student 7,450 Points

Try this,

I hope that will work for you

@media screen and (min-width: 320px) and (max-width: 568px) {
      ul#menu { display: none; }
}

@media screen and (min-width: 320px) and (max-width: 568px) {
      ul#menu { display: none; }
}

In your body you should have something like the following code :

      <ul id="menu"  >
      <li>menu1</li>
      <li>menu2</li>
</ul>
Emma Davis
Emma Davis
4,760 Points

Why not just remove the min-width: 320px as otherwise it will still display on screen sizes smaller than that (so isn't really required anyway)