Build a Job Application Form - Build a Job Application Form

Tell us what’s happening:

Hi Everyone!
I stucked 15th step. I did every thing and all my codes are running correctly but step not pass. I am missing out something but what? I need some fresh eyes for check my code! thanks in advance.
15. 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>
   <link rel="stylesheet" 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>
    <header><h1>Job Application Form</h1></header>
<div class="container">
    <form>
        
        <label>Full Name:</label>
        <input class="name" type="text" id="name"></input>

        <label>E-mail:</label>
        <input class="email" type="email" id="email"></input>

        <label>Select a position:</label>
        <select id="position">
   <option>Web Developer</option>
   <option>Tech Engineer</option>
   <option>Data Entrist</option>
   <option>IT Scientist</option>
        </select>
        

                 <label id="radio-group">Choose your work-time:</label>
        <fieldset class="radio-group" name="availability">

          <input type="radio" name="availability"><label class="radio"> Full-Time</label></input> 
          <input type="radio" name="availability"><label class="radio"> Part-Time</label></input> 
          <input type="radio" name="availability"><label class="radio">Only Night-Time</label></input>
        </fieldset>
        

        <label class="message">Why do you want this job?</label>
        <textarea id="message"></textarea>
        <button type="submit">SUBMIT</button>
    </form>
</div>
</body>
</html>
/* file: styles.css */
body {
    font-family: Arial, sans-serif;
    padding: 0;
    background-color: #cec6c6;
}

h1 {
  text-align: center;
 
}

.container {
    max-width: 90%;
    margin: 5px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

form {
    display: flex;
    flex-direction: column;
}

input, select, textarea {
    margin-bottom: 16px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 16px;
    font-size: 16px;
    
}

button {
  border-radius: 16px; 
  font-weight: bold;
  height: 40px;
}

input:focus, textarea:focus { 
    outline: none !important;
    border-color: yellow;
    background-color: rgba(248, 204, 204, 0.452);
    box-shadow: 0 0 10px #719ECE   
 }

 select:focus { 
    outline: none !important;
    border-color: yellow;
    background-color: rgba(248, 204, 204, 0.452);
    box-shadow: 0 0 10px #719ECE 
 }

button:hover {
  background-color: green;
  color: white;
}

input:invalid, select:invalid, textarea:invalid {
  border-color: red;
}

input:valid, select:valid, textarea:valid {
  border-color: green;
}

.radio-group input[type="radio"]:checked {
  -webkit-appearance: none;
  border-color: red;
  background-color: rgb(9, 9, 247);
  box-shadow: 0 1px  rgb(180, 180, 6);
  margin-top: 16px;
  border-radius: 50%;
  height: 12px;
  width: 12px;
}

.radio-group input[type="radio"] {
  margin-top: 16px;
  width: 10%;

}


    
.radio-group input[type="radio"]:checked + label {
  color: blue;
}


input:nth-child(1) {
    border-radius: 16px;
}

.message {
  padding-top: 16px;
}

fieldset {
  
  border-radius: 16px;
  border-color: green;
  border-width: 1px;
  }
  




Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Build a Job Application Form - Build a Job Application Form

Hi @HarunSular,

I guess, it’s because you put an end tag in the input element, when it should be a self closing tag.

From your CSS, you used + which is an adjacent sibling selector. If you keep having a closing tag on you input element, and inside it contained the label element, it won’t be adjacent anymore.

1 Like

thank you for your answer I changed that but it is still same :slight_smile:

ohh, I know it! you seem to forgot on including id and for attributes.

1 Like

did it worked now? :grinning:

1 Like

input is a void element, you can’t put the </input> closing tag

there are two ways to link input and label together, one is nesting the input inside label (not label inside input!)
the other is using the for attribute

2 Likes

thank you very much for your assistance. It is ok now. thank you again: :clap: :clap: :clap:

1 Like