Build an Availability Table - Build an Availability Table

Tell us what’s happening:

All tests pass, but I can’t see the color gradient in the legend. Am I not supposed to see it? I’ve tried giving it height and width properties, but that doesn’t seem to change anything.

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">
    <link rel="stylesheet" href="styles.css">
    <title>Availability Table</title>
</head>

<body>
    <table>
        <tr class="sharp">
            <th></th>
            <th>Monday</th>
            <th>Tuesday</th>
            <th>Wednesday</th>
        </tr>
        <tr class="half">
            <th class="time">08:00</th>
            <td class="available-5"></td>
            <td class="available-0"></td>
            <td class="available-4"></td>
        </tr>
        <tr class="sharp">
            <th class="time">10:00</th>
            <td class="available-4"></td>
            <td class="available-3"></td>
            <td class="available-2"></td>
        </tr>
        <tr class="half">
            <th class="time">12:00</th>
            <td class="available-1"></td>
            <td class="available-2"></td>
            <td class="available-5"></td>
        </tr>
        <tr class="sharp">
            <th class="time">14:00</th>
            <td class="available-3"></td>
            <td class="available-0"></td>
            <td class="available-2"></td>
        </tr>
    </table>
<div id="legend">
    <span>Availability</span>
    <div id="legend-gradient">
    </div>
</div>
</body>

</html>
/* file: styles.css */
:root {
    --color0: rgb(51, 197, 76);
    --color1: rgb(238, 255, 0);
    --color2: rgb(69, 29, 87);
    --color3: rgb(88, 193, 211);
    --color4: rgb(201, 79, 109);
    --color5: rgb(228, 167, 117);
    --solid-border: 2px solid black;
    --dashed-border: 2px dashed red;

}

.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 {
    height: 40px;
    width: 80%;
    background-image: linear-gradient(
        to right,
        var(--color0) 0% 15%,
        var(--color1) 16% 31%,
        var(--color2) 32% 47%,
        var(--color3) 48% 64%,
        var(--color4) 65% 80%,
        var(--color5) 81% 100%,
    );
}


Your browser information:

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

Challenge Information:

Build an Availability Table - Build an Availability Table

You have an extra comma at the end of your linear gradient


var(--color5) 81% 100%,

Ditched that last comma and see if that works.

1 Like

That got it! I am surprised that the extra comma at the end of the expression kept the whole thing from displaying. Thanks!

Yep we live in a world of a missing semicolon could take out the rest of your CSS! Lol.