使用垂直对齐文本?

发布于 2025-01-01 15:38:09 字数 566 浏览 1 评论 0原文

由于某种原因,我的输入之一表现得很奇怪。我为所有输入应用通用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 中测试)。

http://freshbeer.lv/development/en/contact.php

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).

http://freshbeer.lv/development/en/contact.php

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花心好男孩 2025-01-08 15:38:09

也许您想使用 textarea 来代替? input type="text" 仅是单行。

Perhaps you want to use a textarea instead? input type="text" is single line only.

请你别敷衍 2025-01-08 15:38:09

您应该为此使用文本区域元素。

<textarea></textarea>

You should use a Text Area element for that.

<textarea></textarea>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文