我有带有 jquery 提示的文本字段,我如何将字体对齐到中间。我试过 vertical-align: middle 但不起作用。
<style type="text/css">
#name {
border: 1px solid #c810ca;
height: 27px;
}
input[type=text].hint{
color: #fff;
font-size: 11px;
font-family: "times new roman";
}
input[type=text]{
font-size: 13px;
color: #fff;
font-family: "times new roman";
}
表单文本框
<div id="name">
<input name="name" type="text" id="name" title="insert here"/>
</div>
最佳答案
您可以明确设置输入的高度和宽度(在 CSS 中)。这将确保无论字体大小如何,它都保持不变。
关于html - 在文本字段中间对齐字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9555904/