Tell us what’s happening:
- 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 can’t seem to figure out what I’ve done wrong here. Any help is much 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">
<link rel="stylesheet" href="styles.css">
<title>Job Application Form</title>
</head>
<body>
<div class="container">
<form>
<label for="name">Full Name:
<input type="text" id="name">
</label>
<label for="email">Email:
<input type="email" id="email">
</label>
<label for="position">Position: <select id="position">
</label>
<option>---Select Position---</option>
<option>Bartender</option>
<option>Server</option>
<option>Host</option>
<option>Manager</option>
</select>
<br>
Type of Work:
<fieldset class="radio-group">
<legend>
<label for="full">Full-time
<input type="radio" name="availability" id="full"></label>
<label for="part">Part-time
<input type="radio" name="availability" id="part"></label>
<label for="seasonal">Seasonal
<input type="radio" name="availability" id="seasonal"></label>
</legend>
</fieldset>
</label>
<br>
<label for="message"> Additional Comments:
<textarea id="message"></textarea>
</label>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
/* file: styles.css */
input:focus,
textarea:focus {
border-color: cyan;
}
input:invalid,
select:invalid,
textarea:invalid {
border: 2px solid red;
}
input:valid,
select:valid,
textarea:valid {
border: 2px solid green;
}
button:hover {
background-color: lightblue;
}
.radio-group input[type="radio"]:checked {
border: 5px solid cyan;
background-color: lightblue;
box-shadow: 1px 1px 1px 1px blue;
}
.radiogroup input[type="radio"]:checked + label{
color: blue;
}
input:nth-child(1) {
border-radius: 3px;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Challenge Information:
Build a Job Application Form - Build a Job Application Form