Build a Book Inventory App - Build a Book Inventory App

Tell us what’s happening:

i did everything to pass this but i’m not able to make it i also used ai and he gave up tooo so please solve this glitch.

Your code so far

<!-- file: index.html -->

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <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>The Great Gatsby</td>
        <td>F. Scott Fitzgerald</td>
        <td>Fiction</td>
        <td><span class="status">Read</span></td>
        <td>
          <span class="rate three">
            <span></span><span></span><span></span>
          </span>
        </td>
      </tr>
      <tr class="in-progress">
        <td>1984</td>
        <td>George Orwell</td>
        <td>Dystopian</td>
        <td><span class="status">In Progress</span></td>
        <td>
          <span class="rate">
            <span></span><span></span><span></span>
          </span>
        </td>
      </tr>
      <tr class="to-read">
        <td>To Kill a Mockingbird</td>
        <td>Harper Lee</td>
        <td>Classic</td>
        <td><span class="status">To Read</span></td>
        <td>
          <span class="rate">
            <span></span><span></span><span></span>
          </span>
        </td>
      </tr>
      <tr class="read">
        <td>The Hobbit</td>
        <td>J.R.R. Tolkien</td>
        <td>Fantasy</td>
        <td><span class="status">Read</span></td>
        <td>
          <span class="rate one">
            <span></span><span></span><span></span>
          </span>
        </td>
      </tr>
    </tbody>
  </table>

</body>
</html>

/* file: styles.css */
/* Base styles for presentation */
body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background-color: #f5f5f5;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 20px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

/* 1. Global span setup */
span {
  display: inline-block;
}

/* 2. Row background-image attribute selectors */
tr[class="read"] {
  background-image: linear-gradient(to right, #e2f0d9, #ffffff);
}

tr[class="to-read"] {
  background-image: linear-gradient(to right, #fff2cc, #ffffff);
}

tr[class="in-progress"] {
  background-image: linear-gradient(to right, #deeaf6, #ffffff);
}

/* 3. Status badges descendants attribute selectors */
tr[class="to-read"] span[class="status"] {
  border: 1px solid #ffc000;
  background-image: linear-gradient(#fff2cc, #ffe599);
}

tr[class="read"] span[class="status"] {
  border: 1px solid #70ad47;
  background-image: linear-gradient(#e2f0d9, #c6e0b4);
}

tr[class="in-progress"] span[class="status"] {
  border: 1px solid #418ab3;
  background-image: linear-gradient(#deeaf6, #bdd7ee);
}

/* 4. Sizing status badges and rate containers */
span[class="status"], span[class^="rate"] {
  height: 24px;
  width: auto;
  padding: 4px 8px;
}

/* 5. Rating circles (direct children of rate containers) */
span[class^="rate"] > span {
  border: 1px solid #666;
  border-radius: 50%;
  margin: 2px;
  height: 12px;
  width: 12px;
  background-color: transparent;
}

/* 6. Sub-string rating selectors (Matches tests 43+) */
span[class*="one"] :first-child {
  background-image: linear-gradient(#ffcc00, #ff9900);
}

span[class*="two"] :nth-child(-n+2) {
  background-image: linear-gradient(#ffcc00, #ff9900);
}

span[class*="three"] span {
  background-image: linear-gradient(#ffcc00, #ff9900);
}

Your browser information:

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

Challenge Information:

Build a Book Inventory App - Build a Book Inventory App

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-book-inventory-app/66a207974c806a19d6607073.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @newtonjoh11,

Please refer to this reference for information about the different types of attribute selectors:

MDN: Attribute Selectors

Happy coding