Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Responsive Web Design and Testing Refactor the Layout

Khadar Abdulahi
Khadar Abdulahi
1,955 Points

Menu is not working

The Click event not working on menu where its shows no error on the console but it doesn't preform its task don't know why help!!!! https://w.trhou.se/jxaslazq23

Hi khadar, The challenge was At the bottom of this CSS file is a media query. Inside the media query, create a selector that chooses all list items that are nested inside the element with the id of "gallery". Then, inside your newly written selector, set the width property to a value of 28.3333%.

couldn't see a media query at bottom of css file.

try writing a media query with min-width: 480px and select the li with parents id of "gallery" and set it to width:28.3333%..

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Khadar! For some reason, this question is linked to a challenge, but your question seems to be about your code in your workspace. You've correctly selected the element in question, but you're using nav.display. This should be nav.style.display.

You can find your corrected code below:

const menu =document.querySelector('#menu');
const nav =document.querySelector('#main_menu');
menu.addEventListener("click", ()=>{
   if(nav.style.display=='block'){
       nav.style.display='none';
   }
    else{
        nav.style.display='block';
    } 
});

When I do this, your button works! However, you will need to refresh the page and possibly even clear the browser cache to see the changes.

Hope this helps! :sparkles:

I am running into an error for this question. Here is my code but I am getting "Bummer!"

gallery li {

width: 28.333%; }