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.
input[type=“radio”]:checked + label {
font-weight:bold; /* Changes the label text to red when its radio button is checked */
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">Full Name: </label>
<input type="text" id="name" placeholder="FullName">
<label for="email">email</label>
<input type="email" id="email" placeholder="Email">
<select id="position">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<fieldset class="radio-group">
<legend>availability</legend>
<input type="radio" name="availability" id="availability">
<label for="availability">FullTime</label>
<input type="radio" name="availability" id="availability">
<label for="availability">PartTime</label>
<input type="radio" name="availability" id="availability">
<label for="availability">Remote</label>
<br></br>
<label for="message">Why do you want this Job?</label>
<textarea id="message" name="message" rows="5" cols="50">
</textarea>
</fieldset>
<button type="submit">Submit!</button>
</form>
</div>
</body>
</html>
/* file: styles.css */
input:focus,textarea:focus{
border:1px solid #e99494;
}
input:invalid,
select:invalid,
textarea:invalid{
border:1px solid red;
}
input:valid,
select:valid,
textarea:valid{
border:1px solid green;
}
button:hover{
background-color:gray;
}
.radio-group input[type="radio"]:checked{
border:1px solid purple;
background-color:midnightblue;
box-shadow:5px 5px 10px gray;
}
input:first-of-type {
border-radius: 15px; /* Adds rounded corners */
background-color: #f0f0f0; /* Changes background color for visibility */
}
. You should use the :checked pseudo-class on radio buttons to change the text color of the associated label when the option is selected.
input[type="radio"]:checked + label {
font-weight:bold; /* Changes the label text to red when its radio button is checked */
}
Your browser information:
User Agent is: Mozilla/5.0 (iPad; CPU OS 26_2_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/143.0.7499.151 Mobile/15E148 Safari/604.1
Challenge Information:
Build a Job Application Form - Build a Job Application Form
