Freecodecamp HTML Project “Build a Survey Form”
Customer Satisfaction Survey
Please take a moment to tell us about your experience
Live Check: https://saideresearch.github.io/surveyform/
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Survey Form</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f6f8;
margin: 0;
padding: 20px;
}
h1, p {
text-align: center;
}
form {
background: #ffffff;
max-width: 500px;
margin: 20px auto;
padding: 20px;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
label {
display: block;
margin-top: 15px;
font-weight: 500;
}
input, select, textarea {
width: 100%;
margin-top: 5px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 14px;
}
input[type="radio"],
input[type="checkbox"] {
width: auto;
margin-right: 5px;
}
textarea {
resize: vertical;
min-height: 80px;
}
button {
width: 100%;
margin-top: 20px;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<h1 id="title">Customer Satisfaction Survey</h1>
<p id="description">Please take a moment to tell us about your experience</p>
<form id="survey-form">
<label id="name-label">Name:
<input id="name" type="text" placeholder="Enter your full name" required>
</label>
<label id="email-label">Email:
<input id="email" type="email" placeholder="Enter your email address" required>
</label>
<label id="number-label">Age:
<input id="number" type="number" min="1" max="120" placeholder="Enter your age">
</label>
<label>How did you hear about us?
<select id="dropdown">
<option value="social">Social Media</option>
<option value="friend">Friend or Family</option>
<option value="ad">Advertisement</option>
<option value="other">Other</option>
</select>
</label>
<label>Would you recommend us to others?</label>
<label>
<input type="radio" name="recommend" value="yes"> Yes
</label>
<label>
<input type="radio" name="recommend" value="maybe"> Maybe
</label>
<label>
<input type="radio" name="recommend" value="no"> No
</label>
<label>What would you like to see improved?</label>
<label>
<input type="checkbox" value="service"> Customer Service
</label>
<label>
<input type="checkbox" value="quality"> Product Quality
</label>
<label>
<input type="checkbox" value="price"> Pricing
</label>
<label>
<input type="checkbox" value="delivery"> Delivery Speed
</label>
<label>Additional comments:
<textarea placeholder="Tell us more about your experience..."></textarea>
</label>
<button id="submit" type="submit">Submit Survey</button>
</form>
</body>
</html>
Try your own way to solve that project.
