Design a Feature Selection Page - Design a Feature Selection Page

Tell us what’s happening:

Hi everyone,
I’m working on the Feature Selection project. All my tests are passing except this one:

  1. When the checkboxes are selected, there should be a checkmark ✓ in the center of the checkbox.

I used input[type=“checkbox”]:checked::before to show the check mark, and it appears in my browser, but the FreeCodeCamp test still fails.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Feature Selection</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <h1>Feature Selection</h1>

    <div class="feature-card-container">
      <label class="feature-card">
        <input type="checkbox"> Dark Mode
      </label>
      <label class="feature-card">
        <input type="checkbox"> Light Mode
      </label>
    </div>
  </body>
</html>

/* file: styles.css */
input[type="checkbox"]{ 
  appearance:none; 
  border:2px solid green; 
  width:20px; height:20px; 
  color:white; 
  vertical-align:middle;
  
  }

input[type="checkbox"]:checked{ 
  background-color:blue; 
  border-color:blue; 
  
  }

input[type="checkbox"]:checked::before {
  content:"✓";
  color: white;
  display: block;
  text-align: center;
  line-height:20px;
  font-size: 16px;
}

Your browser information:

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

Challenge Information:

Design a Feature Selection Page - Design a Feature Selection Page

Have you tried using the ::after pseudo element?

1 Like

Thank you buddy, I changed it from before to after, it passes the test.