【问题标题】:The placeholder text in my text boxes is mis aligned in chrome我的文本框中的占位符文本在 chrome 中未对齐
【发布时间】:2011-07-09 16:02:20
【问题描述】:
【问题讨论】:
标签:
css
forms
textbox
placeholder
【解决方案1】:
从下面的 CSS 中删除 line-height:28px。
.form input[type="text"], .form input.text, .form .calculate_box .calc {
background: transparent url(../images/input-background.png) repeat-x left top;
border: 1px solid #A1A1A1;
margin-left: -1px;
height: 28px;
line-height: 28px;
display: block;
width: 284px;
}
查看附件截图,删除了line-height
【解决方案2】:
不确定这是否是“正确”的做法,但在输入字段中添加 5px 的填充会使电子邮件字段的占位符居中。
只要将它添加到您的 CSS 中,只要它适用于该电子邮件字段即可:
padding: 5px;
【解决方案3】:
我认为你的 line-hight:28 从这里开始:(form.css)
.form { font-family: arial, sans-serif; }
.form input[type=text],
.form input.text,
.form .calculate_box .calc{
background: transparent url(../images/input-background.png) repeat-x left top;
border: 1px solid #a1a1a1;
margin-left: -1px;
height: 28px;
line-height: 28px;
display: block;
width:284px;
}
导致问题。请记住,此声明适用于标签的内容,以及标签本身。当涉及到表单时,这可以帮助您..