如何将文本和下拉列表垂直居中以使它们保持水平?
<p>
<span>Hello World</span><select><option>Hello</option></select>
</p>
span {
font-size: 50px;
}
答案 0 :(得分:2)
只需将两个元素的vertical-align
property更改为middle
:
span, select {
vertical-align: middle;
}
span {
font-size: 50px;
}
span,
select {
vertical-align: middle;
}
<span>Hello World</span><select><option>Hello</option></select>