Tell us what’s happening:
i have tried different code on this question, but it is not working., i need help.
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.
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 href="styles.css" rel="stylesheet">
</head>
<body>
<div class="container">
<form>
<fieldset>
<legend>Personal details</legend>
<label for="name">Full Name:</label>
<input type="text" id="name" name="name"><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email">
</fieldset><br>
<fieldset>
<select id="position" name="position">
<option value="web-developer">Web developer</option>
<option value="data-analyst">Data Analyst</option>
<option value="hr-manager">HR Manager</option>
<option value="cyber-security">Cyber Security</option>
</select>
</fieldset><br>
<fieldset class="radio-group">
<legend>Availability</legend>
<label class="choice" for="part-time">Part-Time</label>
<input type="radio" id="part-time" name="availability">
<label class="choice" for="full-time">Full-Time</label>
<input type="radio" id="full-time" name="availability">
</fieldset><br>
<label for="message">Other Message</label>
<fieldset>
<textarea id="message" name="message"
rows="15" cols="30"></textarea>
</fieldset><br>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
/* file: styles.css */
input:focus,textarea:focus {border: 50px solid yellow;}
input:invalid, select:invalid, textarea:invalid {border: 5px solid red;
}
input:valid, select:valid, textarea:valid {border: 3px solid green;
}
button:hover {color: purple;
background-color: orangered;}
.radio-group input[type="radio"]:checked {
outline: none;
color: green;
border: 5px solid green;
background-color: green;
box-shadow: 0 0px 1px 3px green
}
.radio-group input[type="radio"]:checked ~ label {
color: green;
}
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
Challenge Information:
Build a Job Application Form - Build a Job Application Form
https://www.freecodecamp.org/learn/full-stack-developer/lab-job-application-form/lab-job-application-form
