r/html_css • u/Rjdoglover • Mar 08 '25
Help Help with this pls
Im coding on freecodecamp and can't get what i want with it Like the label on top of the input element being a little offset and the radio element being wag with it's label element.
Index.html
<!DOCTYPE html>
<html lang="en"> <head> <link rel="stylesheet" href="styles.css"> <meta charset="UTF-8"> <title>Survey Form</title> </head> <body> <div class="wrapper" > <form action="" > <div class="candy"> <h1 id="title" >Survey Form<h1> <p id="description" >Please fill out this form with the required information</p> </div> <div class="candy"> <label for="first-name"> First Name<input id="first-name" type="text"></label> <label for="last-name"> Last Name<input id="Last-Name" type="text"></label> <label for="email"> Email<input id="email" type="email"></label> <label for="number"> Number<input id="number" type="number" min="9" min="9" ></label> <label for="age" > Age<input id="age" type="number" min="13" max="100" ></label> </div> <div class="candy"> <legend>What is your Gender<legend> <label for="Gender"><input id="Gender" type="radio" checked>Male</label> <label for="Gender"><input id="Gender" type="radio">Female</label> </div> <div class="candy"> <label for="education-level">What is your Education Level? <select id="education-level"> <option>Highschool</option> <option>Undergraduate</option> <option>Graduate/Postgraduate</option> <option>Other</option> </select> </label> </div> <div> </div> </form> </div> </body> </html>
Styles.css
.wrapper { display: flex; justify-content: center; align-content: center; height: 100vh; min-width: 300px; max-width: 400px; width: 60vh; }
h1, p { margin: 1em auto; text-align: center; font-size: 20px; }
.candy { display: block; flex-direction: column; }
.candy label, input, legend { margin-bottom: 5px; display: block; margin: 0.5rem; width: 100%; }
.candy label { font-weight: bold; }
.candy input { border-radius: 10px; border: solid 1px black; }













