When a form is put inside a div, there's always extra space at the bottom of the form for some reason. How do we get rid of that space?
In the code snippets from stack overflow, it doesn't actually show the space, but anywhere else, it does. The code below is all there is.
div {
border: 1px solid blue;
}
form {
border: 1px solid red;
}
<div>
<form>
Form
</form>
</div>
White space (negative space) is the area between design elements. It's another tool for designers to design for the user experience (UX). Remember that white space is not necessarily white; it's just the name to indicate spaces where there are neither user interface (UI) elements nor specific content.
The gap is caused by the margin in your body-wrapper div. margin: -85px auto -60px auto the '-60px' is the culprit (bottom-margin). Reduce or increase it to alter your gap. Save this answer.
You can refer to web developer tools (F12), and you'll see that a form
element comes with a margin-bottom: 1em
, as defined in the browser's default stylesheet:
You can override that by defining your own margin rule:
form { margin-bottom: 0; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With