Tell us what’s happening:
I have tried all what i can in this code but still the same problems. I will send them.
46. 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.
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>The Three Musketeers</td>
<td>Alexandre Dumas</td>
<td>Historical Novel</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>The Plague</td>
<td>Albert Camus</td>
<td>Philosophical Novel</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>The Metamorphosis</td>
<td>Franz Kafka</td>
<td>Novella</td>
<td><span class="status">In Progress</span></td>
<td><span class="rate three"><span></span><span></span><span></span></span></td>
</tr>
</tbody>
</table>
</body>
</html>
/* file: styles.css */
/* Row gradients */
tr[class="read"] {
background-image: linear-gradient(to right, #d4edda, #a8e6a3);
}
tr[class="to-read"] {
background-image: linear-gradient(to right, #f8f9fa, #dee2e6);
}
tr[class="in-progress"] {
background-image: linear-gradient(to right, #fff3cd, #ffd966);
}
/* All spans as inline-block */
span {
display: inline-block;
}
/* Status in to-read rows */
tr[class="to-read"] span[class="status"] {
border: 2px solid #6c757d;
background-image: linear-gradient(to right, #f1f3f5, #dee2e6);
}
/* Status in read rows */
tr[class="read"] span[class="status"] {
border: 2px solid #6c757d;
background-image: linear-gradient(to right, #f1f3f5, #dee2e6);
}
/* Status in in-progress rows */
tr[class="in-progress"] span[class="status"] {
border: 2px solid #495057;
background-image: linear-gradient(135deg, #e3f2fd, #bbdefb);
}
/* Combined selector for .status and [class^="rate"] */
span[class="status"],
span[class^="rate"] {
height: 24px;
width: 90px;
padding: 4px 8px;
}
/* Empty rating stars */
span[class^="rate"] > span {
border: 2px solid #343a40;
border-radius: 6px;
margin: 2px;
height: 14px;
width: 14px;
background-color: #ced4da;
}
/* Test 47: Background for one star */
span[class*="one"] span:first-child {
background-image: linear-gradient(to right, #ffd700, #ffa500);
}
/* Test 49: Background for two stars */
span[class*="two"] span:first-child,
span[class*="two"] span:nth-child(2) {
background-image: linear-gradient(to right, #ffd700, #ffa500);
}
/* Test 51: Background for three stars */
span[class*="three"] span {
background-image: linear-gradient(to right, #ffd700, #ffa500);
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Challenge Information:
Build a Book Inventory App - Build a Book Inventory App