Tell us what’s happening:19: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 Checked everything i didn’t find the problem..
Your code so far
<!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>
<main>
<div class="container">
<h1>Job Application Form</h1>
<form>
<label for="name">Full Name:</label>
<input
id="name"
name="name"
type="text"
placeholder="E.g., John Doe"
required
/>
<label for="email">Email:</label>
<input
id="email"
name="email"
type="email"
placeholder="johndoe@email.com"
required
/>
<label for="position">Position:</label>
<select
id="position"
name="position"
required
>
<option value="">Select a Position</option>
<option value="ui-ux-designer">UI/UX Designer</option>
<option value="front-end">Front-end Developer</option>
<option value="back-end">Back-end Developer</option>
<option value="manager">Manager</option>
<option value="cyber-security">Cyber Security</option>
<option value="seo-optimizer">SEO Optimizer</option>
</select>
<fieldset class="radio-group">
<legend>Availability:</legend>
<input id="full-time" type="radio" name="availability" value="full-time" checked />
<label for="full-time">Full-Time</label>
<input id="part-time" type="radio" name="availability" value="part-time" />
<label for="part-time">Part-Time</label>
<input id="contract" type="radio" name="availability" value="contract" />
<label for="contract">Contract</label>
</fieldset>
<label for="message">Why do you want this job?</label>
<textarea
id="message"
name="message"
rows="5"
cols="40"
placeholder="Write your motivation here..."
required
></textarea>
<button type="submit">Submit Application</button>
</form>
</div>
</main>
</body>
</html>
* {
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Arial, sans-serif;
background: linear-gradient(135deg, #f0f4f8, #d9e4f5);
margin: 0;
padding: 40px 20px;
color: #2b2b2b;
}
.container {
display: block;
background-color: #ffffff;
width: 90%;
max-width: 600px;
border-radius: 14px;
margin: 0 auto;
padding: 40px 45px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
h1 {
text-align: center;
color: #1f2937;
margin-bottom: 30px;
font-size: 1.8rem;
}
form {
display: flex;
flex-direction: column;
gap: 6px;
}
label {
font-weight: 600;
font-size: 0.9rem;
color: #374151;
margin-top: 14px;
}
input,
select,
textarea {
display: block;
width: 100%;
padding: 10px 14px;
margin-top: 6px;
border: 2px solid #d1d5db;
border-radius: 8px;
font-size: 1rem;
font-family: inherit;
background-color: #f9fafb;
transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
textarea {
resize: vertical;
min-height: 100px;
}
input:focus,
textarea:focus {
border-color: #22c55e;
outline: none;
box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
input:invalid,
select:invalid,
textarea:invalid {
border-color: red;
}
input:valid,
select:valid,
textarea:valid {
border-color: green;
}
input:first-of-type {
border-radius: 16px;
background-color: #eef2ff;
}
.radio-group {
border: 2px solid #e5e7eb;
border-radius: 10px;
padding: 16px 20px;
margin-top: 16px;
}
.radio-group legend {
font-weight: 700;
color: #1f2937;
padding: 0 8px;
}
.radio-group label {
display: inline-block;
margin: 6px 16px 6px 6px;
font-weight: 500;
color: #4b5563;
transition: color 0.2s ease;
}
.radio-group input[type="radio"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
display: inline-block;
width: 18px;
height: 18px;
padding: 0;
margin: 0;
border: 2px solid #9ca3af;
border-radius: 50%;
box-sizing: border-box;
vertical-align: middle;
cursor: pointer;
flex-shrink: 0;
transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.radio-group input[type="radio"]:checked {
border-color: #22c55e;
background-color: #22c55e;
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}
.radio-group input[type="radio"]:checked + label {
color: #16a34a;
font-weight: 700;
}
button {
margin-top: 24px;
padding: 12px 20px;
background-color: #22c55e;
color: #ffffff;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.25s ease;
}
button:hover {
background-color: #16a34a;
}
button:active {
background-color:#22c55e;
}
Lesson URL (copy - paste from your browser’s address bar)