An input
element, unlike a div
, comes with a default width.
Here's a simple illustration of this setting:
The browser automatically gives the input
a width.
input {
border: 1px solid blue;
display: inline;
}
div {
border: 1px solid red;
display: inline;
}
<form>
<input>
<br><br>
<div></div>
</form>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…