Learn Responsive Web Design by Building a Piano - Step 6

I don’t know what I’m doing wrong

  **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>
  <div id="piano">
    <div class="keys">
      <div class="key"></div>
      <div class="black--key"></div>
      <div class="black--key"></div>
      <div class="key"></div>
      <div class="black--key"></div>
      <div class="black--key"></div>
      <div class="black--key"></div>
    </div>
  </div>
</body>
</html>
/* file: styles.css */

  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15

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

Link to the challenge:

This step asked you to add the class black--key to some of the .key div elements.
Instead you replaced the class key with black-key.

2 Likes

well, the error is in the class. you need not create a new class selector/element. you simply just type-in the .black–key class right next to the .key. Just separate them with a blank space

3 Likes

for .key the second, third, fifth, sixth, and seventh .keys make it like this:
class=“key black–key”.
and for the first and fourth there is no need to change

6 Likes

Thanks for your explanation.
In general…

<NameElement (space) class=“value1 (space) value2 (space) value3…”>
</ NameElement>

2 Likes
<div id="piano">
      <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>
    </div>

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