Css 将文本下方的位置垂直对齐到顶部
占位符文本在中心垂直对齐,这与名称和电子邮件字段没有关系,但与文本字段没有关系。我希望它与顶部对齐(文本字段的高度为100px) 以下是我使用的CSS:Css 将文本下方的位置垂直对齐到顶部,css,Css,占位符文本在中心垂直对齐,这与名称和电子邮件字段没有关系,但与文本字段没有关系。我希望它与顶部对齐(文本字段的高度为100px) 以下是我使用的CSS: form { width: 500px; margin: 0 auto; } input { font-weight: 300; font-family: 'Open Sans', sans-serif; border-radius: 5px; padding: 10px; } input[t
form {
width: 500px;
margin: 0 auto;
}
input {
font-weight: 300;
font-family: 'Open Sans', sans-serif;
border-radius: 5px;
padding: 10px;
}
input[type="text"] {
display: block;
margin: auto;
margin-bottom: 15px;
width: 250px;
border: 1px solid lightgrey;
}
input[type="submit"] {
display: block;
margin: auto;
width: 272px;
height: 40px;
border: none;
background: steelblue;
color: white;
}
input[class="text-field"] {
height: 100px;
}
我假设您希望此文本字段包含多行文本(因为您将其高度设置为100px),在这种情况下,您可能希望使用一个。这个开关应该可以解决你的垂直对齐问题。你能把你的HTML也贴出来吗。我认为这是默认/标准的方式。谢谢