用float、height、line-height解决
<span style="float:left;height:30px;line-height: 30px">名称:</span>
<input type="text" id="inputSth" style="float:left ;height: 30px;line-height: 30px">
CSS垂直居中技巧
本文介绍了一种使用float、height和line-height属性实现文本和输入框垂直居中的CSS技巧。通过将这些属性应用于span和input元素,可以确保它们在页面上精确对齐。
用float、height、line-height解决
<span style="float:left;height:30px;line-height: 30px">名称:</span>
<input type="text" id="inputSth" style="float:left ;height: 30px;line-height: 30px">

被折叠的 条评论
为什么被折叠?