Tell us what’s happening:
I’m trying to complete the Availability Table exercise but I keep failing the last point #35 about the linear gradient. I checked it many times and tried a few different approaches but I have no idea why it keeps failing. The gradient displays correctly in the preview.
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>Availability Table</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="legend">
<span>Availability</span>
<div id="legend-gradient"></div>
</div>
<table>
<thead>
<tr>
<th></th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
</tr>
</thead>
<tbody>
<tr class="half">
<th class="time">08.00</th>
<td class="available-1"></td>
<td class="available-4"></td>
<td class="available-2"></td>
<td class="available-1"></td>
<td class="available-5"></td>
</tr>
<tr class="half">
<th class="time">09.00</th>
<td class="available-5"></td>
<td class="available-4"></td>
<td class="available-5"></td>
<td class="available-3"></td>
<td class="available-5"></td>
</tr>
<tr class="sharp">
<th class="time">10.00</th>
<td class="available-1"></td>
<td class="available-0"></td>
<td class="available-2"></td>
<td class="available-1"></td>
<td class="available-0"></td>
</tr>
<tr class="half">
<th class="time">11.00</th>
<td class="available-3"></td>
<td class="available-3"></td>
<td class="available-2"></td>
<td class="available-1"></td>
<td class="available-5"></td>
</tr>
<tr class="sharp">
<th class="time">12.00</th>
<td class="available-0"></td>
<td class="available-0"></td>
<td class="available-2"></td>
<td class="available-2"></td>
<td class="available-5"></td>
</tr>
</tbody>
</table>
</body>
</html>
/* file: styles.css */
:root{
--color0:#aaa;
--color1:#dc8;
--color2:#aca;
--color3:#8a7;
--color4:#6a6;
--color5:#393;
--solid-border:2px solid #c94;
--dashed-border:2px dashed #c94;
}
.available-0{
background-color:var(--color0);
}
.available-1{
background-color:var(--color1);
}
.available-2{
background-color:var(--color2);
}
.available-3{
background-color:var(--color3);
}
.available-4{
background-color:var(--color4);
}
.available-5{
background-color:var(--color5);
}
.sharp td{
border-bottom:var(--solid-border);
}
.half td{
border-bottom:var(--dashed-border);
}
#legend-gradient {
width:100px;
height:70px;
border:var(--solid-border);
background-image:linear-gradient(var(--color0) 0% 10%,var(--color1)10% 20%,var(--color2) 20% 30%,var(--color3) 30% 40%,var(--color4) 40% 50%, var(--color5) 50% 100%);
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Challenge Information:
Build an Availability Table - Build an Availability Table