Tell us what’s happening:
This is my code:
button:hover {
background-color: lightblue;
cursor: pointer;
}
.radio-group input[type=“radio”]:checked {
outline: 2px solid blue;
background-color: lightblue;
box-shadow: 0 0 5px blue;
}
.radio-group input[type=“radio”]:checked + label {
color: blue;
font-weight: bold;
}
And it’s giving me error:
15. You should use the :checked pseudo-class on radio buttons to change the text color of the associated label when the option is selected.
My 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>Job Application Form</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<form>
<input type="text" id="name" placeholder="Full Name" required>
<input type="email" id="email" placeholder="Email" required>
<select id="position" required>
<option value="">Select Position</option>
<option value="developer">Developer</option>
<option value="designer">Designer</option>
</select>
<fieldset class="radio-group">
<input type="radio" id="full-time" name="availability" value="full-time" required>
<label for="full-time">Full-Time</label>
<input type="radio" id="part-time" name="availability" value="part-time">
<label for="part-time">Part-Time</label>
</fieldset>
<textarea id="message" placeholder="Enter your message" required></textarea>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
/* file: styles.css */
input:focus, textarea:focus {
border-color: blue;
outline: none;
}
input:invalid, select:invalid, textarea:invalid {
border-color: red;
}
input:valid, select:valid, textarea:valid {
border-color: green;
}
button:hover {
background-color: lightblue;
cursor: pointer;
}
.radio-group input[type="radio"]:checked {
outline: 2px solid blue;
background-color: lightblue;
box-shadow: 0 0 5px blue;
}
.radio-group input[type="radio"]:checked + label {
color: blue;
font-weight: bold;
}
input:nth-child(1) {
border-radius: 10px;
background-color: #f8f8f8;
padding: 8px;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Challenge Information:
Build a Job Application Form - Build a Job Application Form