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 trialPavel Makeev
6,207 PointsSomething wrong with my css
hey, guys. Here's my .js
// Create a select and append in to #menu
var $select = $("<select></select>"); $("#menu").append($select);
// Cycle over menu links $("#menu a").each(function(){ var $anchor = $(this); // create an option var $option = $("<option></option>"); // option's value is the href $option.val($anchor.attr("href")); // option's text is the text of link $option.text($anchor.text()); // append option to select
$select.append($option);
}); //Create a button var $button = $("<button>Go</button>"); $("#menu").append($button); //Bind click to the button $button.click(function(){ //Go to selected location window.location = $select.val(); });
and here is a small piece of css that doesn't work:
@media (min-width: 320px) and (max-width: 720px) { #menu ul { display: none; }; };
@media (min-width: 720px){ #menu select, #menu button { display: none; }; };
the second media query seems to be wrong, it does not hide anything. Please, help me to find out where I made a mistake.
1 Answer
Thomas Dimnet
Python Development Techdegree Graduate 43,629 PointsHi Pavel,
I think I've found your mistake. Here you are with your code:
@media (min-width: 320px) and (max-width: 720px) { #menu ul { display: none; }; };
@media (min-width: 720px){ #menu select, #menu button { display: none; }; }
I think you should try to remove the two semicolons you are using after the curly braces. Maybe you should try this one:
@media (min-width: 320px) and (max-width: 720px) {
#menu ul {
display: none;
}
}
@media (min-width: 720px){
#menu select,
#menu button {
display: none;
}
}
Pavel Makeev
6,207 PointsPavel Makeev
6,207 PointsUnfortunately, tha doesn't work :(