我有一个带有jquery的文本字段,我该如何把字体放在中间。我已经尝试垂直对齐:中间,但不起作用。
<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>发布于 2012-03-04 23:08:24
您可以显式地设置输入的高度和宽度(在CSS中)。这将确保无论字体大小如何,它都保持不变。
发布于 2012-03-05 01:35:31
如果write是单行文本,您可以使用行高表示垂直对齐:中间。当行高和 height 高度相同时,文本居中。例如:
https://stackoverflow.com/questions/9555904
复制相似问题