. -, border, font-family, font-size, line-height padding.
To use a property height, define display: inline-blockfor both elements. In addition, it box-sizing: content-boxguarantees that they have the same box-sizing , that is, the way paddingand bordersaffect them heightand width.
.one, .two, .in {
box-sizing: content-box;
background-color: #ffffff;
border: solid 1px #ADADAD;
height: 17px;
display: inline-block;
font-family: sans-serif;
font-size: 16px;
line-height: 18px;
padding: 2px;
}
<div class="cnt">
<label>
<span class="one">Test in Span</span>
<span class="two">Span in test</span>
</label>
<input class="in" value="mmmnnnxx" type="text" />
</div>
Run codeHide result source
share