Build a Job Application Form: Test 17

Tell us what’s happening:

Hello, I am having the common issue with the 17th test. I have read various threads on this but seem to be missing something. Thank you in advance for any insight!

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>Job Application Form</title>
</head>

<body>
    <header>
        <h1>Application Form</h1>
    </header>
    <div class="container">
        <form>
            <label for:"name">Name:</label>
            <input type="text" id="name" placeholder="John Doe">

            <label for:"email">Email:</label>
            <input type="email" id="email" placeholder="example@email.com">
            
            <label for:"position">Position:</label>
            <select id="position">
                <option>Option A</option>
                <option>Option B</option>
                <option>Option C</option>
                <option selected>Undecided</option>
            </select>

            <p class="available">Availability:</p>

            <fieldset class="radio-group">
                <div class="avail-container">
                    <input type="radio" id="full-time" name="availability">
                    <label for:"full-time">Full-Time</label>
                </div>
                <div class="avail-container">
                    <input type="radio" id="part-time" name="availability">
                    <label for:"part-time">Part-Time</label>
                </div>
            </fieldset>

            <textarea id="message"></textarea>

            <button class="btn-submit" type="submit">Submit Application</button>
        </form>
    </div>
</body>
</html>











/* file: styles.css */
* {
  padding: 0; 
  margin: 0;
  box-sizing: border-box;
}

body {
  margin: 0 12px;
  color: #212121;
  background-color: #f1f3f5;
}

header {
  text-align: center;
  margin: 24px 0 48px 0;
}

input, label {
  display: block;
}

label {
  margin: 12px 0 4px 0;
  font-size: 1.4rem;
  font-weight: bold;
}

input {
  border: 1px solid black;
  width: 100%;
}

select {
  width: 100%;
  margin-bottom: 24px;
}

fieldset {
  margin: 4px 0 12px 0;
}

.btn-submit {
  display: block;
  margin: 12px 0; 
  padding: 8px;
}

.available {
  font-size: 1.4rem;
  font-weight: bold;
}

.radio-group{
  display: flex;
  justify-content: space-around;
}

.radio-group input{
  width: 1.5rem;
}

.avail-container {
  display: flex;
  gap: 12px;
  padding: 6px;
}

.avail-container label{
  font-size: 1rem;
  font-weight: normal;
}

input:focus, textarea:focus {
  outline: none;
  border: 4px solid midnightblue;
}   

input:invalid, select:invalid, textarea:invalid {
    border: 1px solid red;
}

input:valid, select:valid, textarea:valid {
    border: 1px solid green;
}

.radio-group input[type="radio"]:checked{
  border-color: green; 
  background-color: lightgreen;
  box-shadow: 0 0 2px #f1f3f5; 
  accent-color: green;
}

input[type="radio"]:checked + label{
  color: green;
}

/* just to meet #18 */
input:first-of-type {
  font-style: normal;
}

button:hover {
  background-color: lightgreen;
}

#message {
  width: 100%;
  height: 100px;
}

.btn-submit {
  width: 100%;
}

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 Job Application Form - Build a Job Application Form

what is test 17 for? what is the relevant part of your code?

Apologies for my lack of information!

Failed:17. You should use the :checked pseudo-class on radio buttons to change the text color of the associated label when the option is selected.

The relevant part of my code would be:

CSS
input[type=“radio”]:checked + label{
color: green;
}

I am getting the intended result in the preview, but am still failing the test.

what about the html? are the label and input linked correctly?

1 Like

Ahh I see the error, and it works now! I was going crazy reading so many things and it was a easier fix than I was thinking..

Thank you for pointing me in the right direction!