Build a Book Inventory App - Build a Book Inventory App

Tell us what’s happening:

i couldnt understand what wrong i done i tried to understand the conept but still its getting error

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>
      <th>Title</th>
        <th>Author</th>
        <th>Category</th>
        <th>Status</th>
        <th>Rate</th>
    </thead>

    <tbody>
      <tr class="read">
        <td>The art of being Alone</td>
        <td>Renuka</td>
        <td>self-improvement</td>
        <td><span class="status">Read</span></td>
        <td><span class="rate three">
          <span></span><span></span><span></span>
        </span></td>  
      </tr>

      <tr class="to-read">
        <td>Never Finsihed</td>
        <td>David Goggins</td>
        <td>self-improvement</td>
        <td><span class="status">To Read</span></td>
        <td><span class="rate two">
          <span></span><span></span><span></span>
          </span></td>
       </tr>

       <tr class="in-progress">
         <td>Deep Work</td>
         <td>Cal Newport</td>
         <td>Productivity</td>
         <td><span class="status">In Progress</span></td>
         <td><span class="rate one">
            <span></span><span></span><span></span>
          </span></td>
       </tr>

    </tbody>      


    </tbody>



  </table>

</body>

</html>
/* file: styles.css */
tr[class="read"] {
  background-image: linear-gradient(to right, #c9f0c9, #e6ffe6);
}
tr[class="to-read"] {
  background-image: linear-gradient(to right, #fef3c7, #fff8dc);
}
tr[class="in-progress"] {
  background-image: linear-gradient(to right, #dbeafe, #e0f2fe);
}

span{
  display:inline-block;
}

tr[class="to-read"] span[class="status"]{
  border:2px solid orange;
  background-image: linear-gradient(to right, #fde68a, #fcd34d);)
}

tr[class="read"] span[class="status"]{
  border:2px solid green;
   background-image: linear-gradient(to right, #6ee7b7, #34d399);
}

tr[class="in-progress"] span[class="status"]{
  border: 2px solid cyan;
  background-image: linear-gradient(to right, #93c5fd, #60a5fa);
  
}
span[class="status"],
span[class^="rate"] {
  height: 1.5rem;
  width: 4.5rem;
  padding: 0.25rem;
}
span[class^="rate"] > span {
  border: 1px solid #999;
  border-radius: 50%;
  margin: 2px;
  width: 1rem;
  height: 1rem;
  background-color: #ccc;
}

span[class*="one"] > span:first-child {
  background-image: linear-gradient(to right, red, orange);
}

span[class*="two"] > span:nth-child(-n+2) {
  background-image: linear-gradient(to right, green, yellow);
}

span[class*="three"] span {
  background-image: linear-gradient(to right, blue, purple);
}

Your browser information:

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

Challenge Information:

Build a Book Inventory App - Build a Book Inventory App

what error are you getting?

Consider constraining your selector to match the whole word rather than using a wildcard to match a substring.

This article explains how to do that:
CSS Selectors – Cheat Sheet for Class, Name, Child Selector List

    1. You should have an attribute selector to target the first descendant of span elements that have the word one as a part of their class value.
  • Failed:47. You should use an attribute selector to target the first descendant of span elements that have the word one as a part of their class value and set its background-image property to use a linear-gradient.

  • Failed:48. You should have an attribute selector to target the first two descendants of span elements that have the word two as a part of their class value.

  • Failed:49. You should use an attribute selector to target the first two descendants of span elements that have the word two as a part of their class value and set their background-image property to use a linear-gradient.

  • Failed: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.

  • Failed:51. You should use 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 and set their background-image property to use a linear-gradient.

take the first one, which part of your code do you think satisfies the test?

1 Like