Tell us what’s happening:
Regarding the Build a Job Application Form, I have passed all tests accept #18: “You should use the :checked pseudo-class on radio buttons to change the text color of the associated label when the option is selected.”
I have checked this forum and none of the explanations make any sense to me. Also, Google is convinced that .raditoo-group input[type=“radio”]:checked + label { color: your color;} is the proper route. The proper code would be appreciated.
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>
<input type="text" id="name">
<label for="name">Full Name:</label>
<input type="email" id="email">
<label for="email">Email:</label>
<select id="position">
<option value="police-officer">Police Officer</option>
<option value="auxiliary-oficer">Auxiliary Officer</option>
</select>
<fieldset class="radio-group">
<label>Full Time:<input type="radio" name="availability"></label>
<label>Part Time:<input type="radio" name="availability"></label>
<textarea id="message"></textarea>
</fieldset>
<button type="submit">Submit Application</button>
</form>
</div>
</body>
</html>
/* file: styles.css */
input:focus, textarea:focus {
border-color: blue;
}
input:invalid, select:invalid, textarea:invalid {
border-color: red;
}
input:valid, select:valid, textarea:valid {
border-color: green;
}
button:hover {
background-color: purple
}
.radio-group input[type="radio"]:checked {
border-color: yellow;
background-color: lightblue;
box-shadow: 0 0 5px gray;
}
.radio-group input[type="radio"]:checked, .radio-group label:checked {
color: indigo;
}
input:first-of-type {
border-left: 5px solid orange;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0
Challenge Information:
Build a Job Application Form - Build a Job Application Form