Tell us what’s happening:
My labels change color but I can’t get past step 15. Use the :checked pseudo-class on radio buttons to change the text color of the associated label when the option is selected.
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>Job Application Form</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<form>
<label for="name">Enter name:</label><br />
<input type="text" id="name" name="name" /><br />
<label for="email">Enter email:</label></br>
<input type="email" id="email" name="email" /><br />
<label from="position">Preferred role:</label><br />
<select id="position">
<option value="">--Please choose an option--</option>
<option value="consultant">Consultant</option>
<option value="manager">Manager</option>
<option value="executive-assistant">Executive Assistant</option>
</select>
<fieldset class="radio-group">
<legend>Work availability</legend>
<input type="radio" id="full-time" name="availability" value="full-time" />
<label from="full-time">Full-Time</label>
<input type="radio" id="part-time" name="availability" value="part-time" />
<label from="part-time">Part-Time</label>
</fieldset>
<label for="message">Message:</label><br />
<textarea id="message" name="message" rows="10" cols="50"></textarea>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
/* file: styles.css */
input:focus, textarea:focus {
border-color: pink;
}
input:invalid, select:invalid, textarea:invalid {
border-color: red;
}
input:valid, select:valid, textarea:valid {
border-color: green;
}
button:hover {
background-color: lightgreen;
}
.radio-group input[type="radio"]:checked {
border-color: blue;
background-color: yellow;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.5);
color: darkblue;
}
.radio-group input[type="radio"]:checked + label {
color: yellowgreen;
}
input:first-of-type {
border-radius: 10px;
}
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 a Job Application Form - Build a Job Application Form