Learn Responsive Web Design by Building a Piano - Step 28

Tell us what’s happening: following the article on this. what am I missing?
Describe your issue in detail here.

   **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html lang="en">
 <head>
   <meta charset="UTF-8" />
   <title>Piano</title>
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="stylesheet" href="./styles.css">
 </head>
 <body>
   <div id="piano">
     <img class="logo" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg" alt="freeCodeCamp Logo" />
     <div class="keys">
       <div class="key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>
       <div class="key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>

       <div class="key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>
       <div class="key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>

       <div class="key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>
       <div class="key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>
       <div class="key black--key"></div>
     </div>
   </div>
 </body>
</html>
/* file: styles.css */
html {
 box-sizing: border-box;
}

*, *::before, *::after {
 box-sizing: inherit;
}

#piano {
 background-color: #00471b;
 width: 992px;
 height: 290px;
 margin: 80px auto;
 padding: 90px 20px 0 20px;
 position: relative;
 border-radius: 10px;
}

.keys {
 background-color: #040404;
 width: 949px;
 height: 180px;
 padding-left: 2px;
}

.key {
 background-color: #ffffff;
 position: relative;
 width: 41px;
 height: 175px;
 margin: 2px;
 float: left;
 border-radius: 0 0 3px 3px;
}

.key.black--key::after {
 background-color: #1d1e22;
 content: "";
 position: absolute;
 left: -18px;
 width: 32px;
 height: 100px;
 border-radius: 0 0 3px 3px;
}

.logo {
 width: 200px;
 position: absolute;
 top: 23px;
}

@media only #piano (max-width: 768px) {
// do something in this width range.
}
   **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

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

Link to the challenge:

Hi!
You need to fill out the media query as the lesson instructs. I’m not sure which article you are reading, but adding a comment like this is not correct.

It might help to read this W3Schools article on media queries.

ok - here is an example from the link you sent me -

@media screen and (min-width: 480px) {
  body {
    background-color: lightgreen;
  }
}

and here is what I have done. Error is Your @media rule should have a #piano selector. How is it not correct?

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

did another try - still isn’t working.

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

There’s no need for and (width: 358px)

3 Likes

thank you :slight_smile: I appreciate the help on this.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.