Build an Availability Table - Build an Availability Table

Tell us what’s happening:

Step 25, I can’t seem to find out where I am making the mistake.

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

<body>

  <table>
    <tr>
      <th></th>
      <th>Monday</th>
      <th>Tuesday</th>
      <th>Wednesday</th>
    </tr>
    <tr class="sharp">
      <th class="time">9:00 AM</th>
      <td class="available-1"></td>
      <td class="available-3"></td>
      <td class="available-2"></td>
    </tr>
    <tr class="half">
      <th class="time">10:00 AM</th>
      <td class="available-0"></td>
      <td class="available-2"></td>
      <td class="available-4"></td>
    </tr>
    <tr class="sharp">
      <th class="time">11:00 AM</th>
      <td class="available-5"></td>
      <td class="available-1"></td>
      <td class="available-0"></td>
    </tr>
    <tr class="half">
      <th class="time">12:00 PM</th>
      <td class="available-3"></td>
      <td class="available-3"></td>
      <td class="available-5"></td>
    </tr>
    <tr class="sharp">
      <th class="time">1:00 PM</th>
      <td class="available-2"></td>
      <td class="available-0"></td>
      <td class="available-1"></td>
    </tr>
  </table>

  <div id="legend">
    <span>Availability</span>
    <div id="legend-gradient"></div>
  </div>

</body>

</html>
/* file: styles.css */
:root {
  --color0: #f0f0f0;
  --color1: #c0e0ff;
  --color2: #80caff;
  --color3: #40b0ff;
  --color4: #0088cc;
  --color5: #005599;

  --solid-border: 2px solid #333;
  --dashed-border: 2px dashed #aaa;
}


    table {
      border-collapse: collapse;
      width: 100%;
      text-align: center;
    }

    th, td {
      padding: 10px;
    }

    .time {
      text-align: center;
      font-weight: bold;
    }

    .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 {
      margin-top: 20px;
      font-family: sans-serif, Arial;
    }

    #legend span {
      font-weight: bold;
      margin-right: auto;
      display: block;
      text-align: center;
    }
/* stucked here, step 25 */

#legend-gradient {
  width: 100%;
  height: 20px;
  background-image: linear-gradient(
  to right,
  var(--color0) 0%, 
  var(--color0) 16%,
  var(--color1) 16%,
  var(--color1) 33%,
  var(--color2) 33%,
  var(--color2) 49%,
  var(--color3) 49%,
  var(--color3) 66%,
  var(--color4) 66%,
  var(--color4) 83%,
  var(--color5) 83%,
  var(--color5) 100%
);
}

Your browser information:

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

Challenge Information:

Build an Availability Table - Build an Availability Table
https://www.freecodecamp.org/learn/full-stack-developer/lab-availability-table/build-an-availability-table

the request is two use two color stops for each color, that means that after each color there should be two percentages, and the colors should not repeat

1 Like

Thank you, got it correct this time

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.