html - CSS 文本输入字段没有对齐左上角?

标签 html css

我正在尝试让输入文本字段在左上角显示文本,现在文本垂直居中,水平居中。

<input class="userInput" type="text">
<style>
.userInput {
text-align: left;
margin: 1px;
padding: 1px;
width: 500px;
height: 300px;
vertical-align: top;
}
</style>

最佳答案

文本输入用于单行输入。我建议使用 <textarea>相反。

示例:https://jsfiddle.net/z58vy354/

关于html - CSS 文本输入字段没有对齐左上角?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34027368/

相关文章:

php - 当我更改 CSS 中的选择器时,样式未应用

html - 无法对齐 div(仅内部图像)和 div(文本)

css - Bootstrap 3 中的按钮边距 : where did they come from?

javascript - 如何检查元素是否存在?

html - Twitter Bootstrap 表单字段太小

css - 鼠标悬停在列表项上晃动

css - 让我的评论出现在指定的 div 容器中

css - 背景图像颜色更改 firefox/chrome

javascript - JavaScript 中的简单年龄验证

html - CSS - 如何使用固定值动态设置 margin-left