Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 将文本下方的位置垂直对齐到顶部_Css - Fatal编程技术网

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

占位符文本在中心垂直对齐,这与名称和电子邮件字段没有关系,但与文本字段没有关系。我希望它与顶部对齐(文本字段的高度为100px)

以下是我使用的CSS:

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也贴出来吗。我认为这是默认/标准的方式。谢谢