Learn Responsive Web Design by Building a Piano - Step 6

Tell us what’s happening:
HI
would someone help me see what I am doing wrong here? I’ve tried it several different ways, and still, It won’t pass the challenge.

This is the instruction that was given:

" Step 6

Remember that a class attribute can have multiple values. To separate your white keys from your black keys, you’ll add a second class value of black--key. Add this to your second, third, fifth, sixth, and seventh .key elements."

Thank you.

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" />
  </head>
  <body>

<!-- User Editable Region -->

    <div id="piano">
      <div class="keys">
        <div class="key" class="black--key"></div>
        <div class="black--key"></div>
        <div class="key"></div>
        <div class="key"></div>
        <div class="black--key"></div>
        <div class="black--key"></div>
        <div class="black--key"></div>
      </div>
    </div>

<!-- User Editable Region -->

  </body>
</html>
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.61

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

Link to the challenge:

don’t create a 2nd class attribute
just add the 2nd class next to the first one (with a space in between)

HI
do you mean like this :point_up_2:?

If yes, I have tried like that, and it still didn’t work. Because according to the instruction, the element supposed to look like that:

But this is the result that I get:

Thank you.

here’s what I meant:

<div class="one two three"></div>

this div has 3 classes

I did that, and it didn’t work. I have tried:

<div class="black--key"> just like the instruction said to, still that didn't work.
<div class="key black"> that didn't work either
<div class="black key"> that didn't work either
<div class="key"  "black"> that didn't work either
<div class="key " class="black--key"> that didn't work either

it doesn’t matter how I tried it, it doesn’t work.
What about the dashes(- -) it supposed to have in the attribute?

try to reset the code and this time add the exact class name (yes with the dashes) to the required elements exactly as I showed you.

All the examples you wrote are incorrect because you either (in order of the code you showed me above)

  • removed the existing class
  • added the wrong class name
  • added the wrong class name (again)
  • used bad syntax with the wrong class name orphaned out of the class attribute
  • duplicated the class attribute

Hi

thank you for your help and patience. I tried:

<div class="black--key"></div>
        <div class="key black-key"></div>
    
       and it worked.  Thank you. Ciao!```
1 Like

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