使用垂直对齐文本?
由于某种原因,我的输入之一表现得很奇怪。我为所有输入应用通用CSS
.text-input {
padding: 6px 10px;
background: #fff;
border-radius: 5px;
-webkit-border-radius: 5px;
width: 330px;
border-bottom: 1px solid #000;
}
,并为一个特定的div应用此特定CSS以使其更高
#letter {
height: 100px;
}
出于某种原因,当我专注于#letter输入并开始键入文本出现在它的垂直中间时,我不知道是什么导致问题,但这是我的页面,如果你专注于“消息”输入,你会明白我的意思(在 Chrome 中测试)。
For some reason one of my inputs acts weird. I apply general css for all my inputs
.text-input {
padding: 6px 10px;
background: #fff;
border-radius: 5px;
-webkit-border-radius: 5px;
width: 330px;
border-bottom: 1px solid #000;
}
and I apply this specific css for one particular div to make it higher
#letter {
height: 100px;
}
For some reason when I focus on #letter input and start typing text appears in vertical middle of it, I don't know what is causing the problem, but here is my page, if you focus on "Message" input you will see what I mean (tested in chrome).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您想使用
textarea
来代替?input type="text"
仅是单行。Perhaps you want to use a
textarea
instead?input type="text"
is single line only.您应该为此使用文本区域元素。
You should use a Text Area element for that.