Hello,
It was very exciting to start the first project on my own, before getting on the CSS at least .
That wasn’t a requirement, but I decided to go the extra mile and craft a nice form like the exemple. There was a bit of a learning curve and it took way more time than I’d like to admit, but I’m happy I made it and I learnt some cool stuff.
I’d love any feedback. Thanks!
(URL for background-image in body had to be removed for the post. It was a random surfing picture from Google)
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Surf Lesson Registration</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Header -->
<header>
<h1 id="title">Surf Lesson Registration Form</h1>
<p id="description">Welcome to our surfschool, <i>the best surfer out there is the one having the most fun!</i>
</p>
</header>
<!-- Form -->
<form id="survey-form">
<!-- Personnal informations -->
<label for="name" id="name-label">Name* <input id="name" type="text" name="full-name" placeholder="Enter your full name" required class="info-input-style"/></label>
<label for="email" id="email-label">Email address* <input id="email" type="email" name="email-address" placeholder="Enter your email address" required class="info-input-style"/></label>
<label for="age" id="number-label">Age (optional) <input id="number" type="number" name="age" placeholder="How old are you?" min="17" max="70" class="info-input-style"/></label>
<!-- Radio for surf level selection -->
<fieldset>
What is your surfing experience?
<div>
<label><input type="radio" name="surfer-level" class="inline" value="1"> Begginer</label>
<label><input type="radio" name="surfer-level" class="inline" value="2"> Intermediate</label>
<label><input type="radio" name="surfer-level" class="inline" value="3"> Advanced
</label>
</div>
</fieldset>
<!-- Dropdown to select a surf spot -->
<fieldset>
<label for="dropdown" id="dropdown-label"> Select your favorite beach to practice
<select id="dropdown" class="info-input-style">
<option>Muizenberg</option>
<option>Hossegor</option>
<option>Hawaii</option>
<option>Ericeira</option>
</select>
</label>
</fieldset>
<!-- Checkboxes for anything extra -->
<fieldset>
Is there anything else you require from the school?
<div>
<label><input type="checkbox" value="1" class="inline"> Rent a surf suit</label>
<label><input type="checkbox" value="2" class="inline"/> Rent a surf board</label>
<label><input type="checkbox" value="3" class="inline"/> Transportation to the beach</label>
<label><input type="checkbox" value="4" class="inline"/> Lunch meal</label>
</div>
</fieldset>
<!-- Text area for comments -->
<fieldset>
<label for="comments"> Let us know anything else :
<textarea id="comments">
</textarea>
</label>
</fieldset>
<!-- submit button to register -->
<button id="submit" form="survey-form" Type="submit" value="Submit">Register for a lesson</button>
</form>
</body>
</html>
CSS
body {
background: url(https://images.pexels.com/photos/111085/pexels-photo-111085.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1) rgba(175, 83, 83, 0.8);
background-blend-mode: multiply;
font-family: Arial;
color: rgb(86, 39, 39);
background-size: cover;
}
/* Form header style */
header {
text-align: center;
color: white;
padding: 1em 1em;
}
h1 {
font-family: Roboto;
}
/* form component styles */
form {
background-color: rgb(239, 207, 49,0.8);
font-size: 20px;
max-width: 800px;
min-width: 300px;
margin: auto;
width: 80%;
border-radius: 10px;
padding: 1em;
}
label, textarea, input, select, button {
display: block;
}
fieldset {
border-style: none;
}
.info-input-style {
width: 95%;
height: 35px;
margin: 1em auto;
background-color: rgba(255, 255, 255, 0.8);
border-style: none;
border-radius: 5px;
padding-left: 20px;
font-size: 16px;
}
div {
padding: 20px 20px 0;
}
select {
font-family: Arial;
color: rgb(86, 39, 39);
}
textarea {
background-color: rgb(255, 255, 255,0.8);
border-radius: 5px;
margin: 20px auto auto;
height: 60px;
width: 95%
}
.inline {
display: inline;
}
/* Submition button style */
button {
background-color: rgb(255, 149, 0);
border-style: none;
border-radius: 5px;
height: 40px;
width: 90%;
margin: 20px auto;
font-family: Roboto;
font-size: 18px;
color: white;
}
button:hover {
box-shadow: 0px 0px 20px 5px red;
}```