Tell us what’s happening:
I have tried various things and I cannot get 46-51.
• Failed: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.
• Failed:48. You should have an attribute selector to target the first two de
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 1</td>
<td>Who wrote the book</td>
<td>Comedy</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 2</td>
<td>I wrote the book</td>
<td>Romance</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 3</td>
<td>They wrote the book</td>
<td>Suspence</td>
<td><span class="status">In Progress</span></td>
<td><span class="rate"><span></span><span></span><span></span></span></td>
</tr>
<tr class="read">
<td>Title 4</td>
<td>She wrote the book</td>
<td>Western</td>
<td><span class="status">Read</span></td>
<td><span class="rate two"><span></span><span></span><span></span></span></td>
</tr>
<tr class="to-read">
<td>Title 5</td>
<td>He wrote the book</td>
<td>Romcom</td>
<td><span class="status">To Read</span></td>
<td><span class="rate"><span></span><span></span><span></span></span></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</body>
</html>
/* file: styles.css */
tr[class="read"] {
background: linear-gradient(red, white);
}
tr[class="to-read"] {
background: linear-gradient(green, white);
}
tr[class="in-progress"] {
background: linear-gradient( blue, pink, white);
}
span {
display: inline-block;
}
tr[class="to-read"] span[class="status"] {
border: 3px solid green;
background-image: url(paper.gif);
}
tr[class="read"] span[class="status"] {
border: 3px solid red;
background-image: url(paper.gif);
}
tr[class="in-progress"] span[class="status"] {
border: 3px solid blue;
background-image: url(paper.gif);
}
span[class="status"], span[class^="rate"] {
border: 3px solid blue;
border-radius: 5px;
margin: 10px;
padding: 5px;
height: 10px;
width: 10px;
background-color: white;
}
tr span[class="status"] {
border: 3px solid blue;
border-radius: 5px;
margin: 5px;
height: 50px;
width: 50px;
font-size: 15px;
background-color: white;
}
tr span[class="read"] {
border: 3px solid white;
border-radius: 5px;
margin: 5px;
height: 50px;
width: 50px;
font-size: 15px;
background-color: white;
}
span[class^="rate"] > span {
border: 1px solid white;
border-radius: 5px;
margin: 2px;
padding: 2px;
height: 10px;
width: 10px;
background-color: rgb(236, 163, 163);
}
span[class="one"]:first-child {
background-image: linear-gradient(to right skyblue, pink);
}
span[class="two"] > :nth-child(-n+2) {
background-image: linear-gradient(to right white, red);
}
span[class="three"] span {
background-image: linear-gradient(to right blue, red);
}
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