HTML
<form>
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" required>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email" required>
</div>
<div class="form-group">
<label for="message">Message:</label>
<textarea class="form-control" id="message" rows="5" required></textarea>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
css
form {
width: 80%;
margin: 0 auto;
border: 1px solid #ccc;
padding: 20px;
border-radius: 5px;
}
.form-control {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 4px;
}
.btn {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
.btn:hover {
background-color: #45a049;
}
@media (max-width: 600px) {
form {
width: 90%;
padding: 10px;
}
.form-control {
width: 100%;
margin-bottom: 10px;
}
.btn {
width: 100%;
padding: 12px 20px;
}
}