Tell us what’s happening:
: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><link rel="stylesheet" type="css" href="styles.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Job Application Form</title>
</head>
<body>
<div class="container"><form><label for="name">Name:</label><input type="text" id="name" name="name" required></input><label for="email">Email:</label><input type="email" id="email" name:"email" required></input><label for="position">Job Position</label><select id="position" name="position" required><option value="">Select a position</option><option value="data">Data Scientist</option><option value="fullstack">Full Stack Developer</option><option value="dtaanalyst">Data Analyst</option></select>
<fieldset class="radio-group"><legend>Availability</legend><input type="radio" name="availability" value="full-time"
id="full-time"><label for="full-time">Full Time</label><input type="radio" name="availability"
value="part-time"
id="part-time"><label for="part-time">Part Time</label></fieldset>
<label for="message">Meassage:</label><textarea id="message" name="message" row="4" required></textarea><button type="submit">Submit</button></form></div>
</body>
</html>
/* file: styles.css */
input:focus,
textarea:focus {border: 2px solid blue;}
input:invalid,
select:invalid,
textarea:invalid {border: 2px solid red;}
input:valid,
select:valid,
textarea:valid {border: 2px solid green;}
button:hover {background-color: green;}
.radio-group input[type="radio"]:checked {border: 2px solid green;
background-color: pink;
box-shadow: 0 0 5px rgba(0, 0, 255, 0.5);}
input [type="radio"]:checked + label {color: pink;}
input:first-of-type {color: skyblue;
background-color: pink;
border-color: red;}
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Challenge Information:
Build a Job Application Form - Build a Job Application Form