Learn Responsive Web Design by Building a Piano - Step 28

Tell us what’s happening:

I figured out how to use proper syntax for the @media query (it is correct in my code), but I STILL have no idea where to get the ‘max-width’ value. I had to figure it out by looking at others’ code and their max-width, but I want to know where that value comes from for later.

Where does the max-width value come from? I can’t find it in any of my source code. Is it a read of my browsers current max-width? How would I know what that is?

Many thanks–

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;
}


/* User Editable Region */

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

/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

Challenge Information:

Learn Responsive Web Design by Building a Piano - Step 29

Hello, the selector is wrong it comes from .keys not #piano also the width is incorrect.
I ran this code from the console output and it passed but from the other post here you need to add another selector.

After that add add a .keys selector and set the width to 318px. Same as you added that selector for #piano

While my code is on Step 29, I am asking about Step 28. I have already solved Step 28.

I want to know where the ‘max-width’ value in my media query comes from, as explained above.

Thank you for hanging with me–

Max- width is not a value it is a property.

I could not find in any instruction where to get the value for the property of max-width. It was not given in the Step 28 instruction.

Ok, but that was from step 27.

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