Build a Book Inventory App - Build a Book Inventory App

Tell us what’s happening:

i need help with this question.
50. You should have an attribute selector to target the span elements that are descendants of span elements that have the word three as a part of their class value

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>Book Inventory</title>
  <link rel="stylesheet" href="styles.css">
</head>

<body>
<h1>Book Inventory</h1>
<table>
  <thead>
    <tr>
      <th>Title</th>
      <th>Author</th>
      <th>Category</th>
      <th>Status</th>
      <th>Rate</th>
    </tr>
  </thead>
  <tbody>
<tr class="read">
  <td>Title</td>
      <td>Author</td>
      <td>Category</td>
      <td><span class="status">Read</span></td>
      <td><span class="rate one"><span></span><span></span><span></span></span></td>
</tr>
<tr class="to-read">
  <td>Title</td>
      <td>Author</td>
      <td>Category</td>
      <td><span class="status">To Read</span></td>
      <td><span class="rate"><span></span><span></span><span></span></span></td>
</tr>
<tr class="in-progress">
  <td>Title</td>
      <td>Author</td>
      <td>Category</td>
      <td><span class="status">In Progress</span></td>
      <td><span class="rate"><span></span><span></span><span></span></span></td>
</tr>
  </tbody>
</table>
</body>

</html>
/* file: styles.css */
tr[class="read"]{
  background-image:linear-gradient(#13afb7 30%,#13afb7 20%);
}tr[class="to-read"]{
  background-image:linear-gradient(#9cf5fb 30%,#9cf5fb 20%);
}

tr[class="in-progress"]{
  background-image:linear-gradient(#5ecbd2 30%,#6fb5ba 20%);
}
span{
  display:inline-block;
}
tr[class="to-read"] span[class="status"]{
  border:2px solid #1d91f7;
  background-image:linear-gradient(#1d91f7 30%,#1decf7 20%);
}
tr[class="read"] span[class="status"]{
border:2px solid red;
background-image:linear-gradient(#7c9597 30%,#7e8b8b 20%);
}
tr[class="in-progress"] span[class="status"]{
  border:2px double yellow;
  background-image:linear-gradient(#7c9597 30%,#7e8b8b 20%);
}
span[class="status"],span[class^="rate"]{
height:100px;
width:100px;
padding:2px;
}
span[class^="rate"] > span{
border:2px solid #fff;
border-radius:2px;
margin:2px;
height:10px;
width:10px;
background-color:#fe0;
}
span[class~="one"] :nth-child(1){
background-image:linear-gradient(#232323 70%, #345667 30%);
}
span[class~="two"] :nth-child(1),span[class~="two"] :nth-child(2){
background-image:linear-gradient(#232323 30%, #345667 30%);
}
span > span[class*="three"]
{
background-image:linear-gradient(#232323 10%, #345667 30%);
}

Your browser information:

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

Challenge Information:

Build a Book Inventory App - Build a Book Inventory App

Hey there! Your selector right now is looking for spans with the class of .three that are descendants of another span. I think the instructions want you to go the other way around. you should style span elements that are descendants of a span with the class of .three.
Also, you might wanna look for the right sign here: class*= . You can look at the other lines of code and see the part you’re missing.
I hope this helps!
Good luck :slight_smile:

Did you intend to use rate-one everything else uses the class rate.

<td><span class="rate one"><span></span><span></span><span></span></span></td>

well, they did tell me to add a class of either one, two or three in the .rate of the .read class .

i still don’t get it

span[class*="three"] span
{
background-image:linear-gradient(#232323 10%, #345667 30%);
}

this is that part of the code so far

The order now is good here ( span[class*="three"] span ). You are just missing a > to show that span is a descendant of span[class*="three"].
Also if you look at the other lines of code similar to yours you see class~="two" or class~="one" . Yours is missing the sign ~ in [class*="three"].
Good luck!

1 Like

thank you so much . it worked.

1 Like