Learn Responsive Web Design by Building a Piano - Step 28

Tell us what’s happening:
Describe your issue in detail here.

Test

Sorry, your code does not pass. Don’t give up.

Hint

Your @media rule should have a #piano selector.
Your code so far

@media (max-width: 768px) #piano {width: 358px;}

/* User Editable Region */


**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36</code>

**Challenge:** Learn Responsive Web Design by Building a Piano - Step 28

**Link to the challenge:**
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-responsive-web-design-by-building-a-piano/step-28
1 Like

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

I am failing to compute the #piano selector within the @media

media queries can be a little confusing at first

try to think of it as a box that only gets opened when something is true.

for example, when the max-width: is less than 768px, follow these instructions

you add the instructions the same way you change anything in CSS,

I can write this if I want my body element to be blue

body {
background-color: blue;
}

But if I only want it to be blue when my width is less than 768 px I will need to nest the instruction within a media query

@media (max-width: 768px) {
    body {
    background-color: blue;
    }
}

You can have as many instructions as you like inside a media query, Its a little like having a new style sheet that gets used when some parameters are met

here is an example of change the body colour to blue, and a class .random to green

@media (max-width: 768px) {
    body {
        background-color: blue;
    }
    .random {
        background-color: green;
    }
}
2 Likes

Thank you vert much for your illustration. It worked :wink:

1 Like

Please I have an issue with a code here
.

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.