gpt4 book ai didi

html - css 适用于输入文本而不是文本区域

转载 作者:搜寻专家 更新时间:2023-10-31 23:03:10 26 4
gpt4 key购买 nike

这是一个 jsfiddle

http://jsfiddle.net/2GpmW/

当我设置 css 时,我是这样做的:

.inputForm input[type="text"], .inputForm input[type="email"], .inputForm textarea, .inputForm select {
border: none;
color: #525252;
height: 30px;
line-height: 15px;
margin-bottom: 10px;
margin-right: 6px;
margin-top: 2px;
outline: 0 none;
padding: 2px 0px 2px 5px;
width: 400px;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
background: #DFDFDF;
font-family: inherit;
font-size: inherit;
}

因此,正如您所看到的,CSS 显示同时应用于输入文本和文本区域,但由于某些原因,文本区域旁边的标签变为向下,并且文本区域内的占位符未像在输入文本中那样垂直居中

请:

1- 为什么会这样?

2-如何解决

非常感谢

最佳答案

你必须使用这个:

textarea{
vertical-align: top;
}

fiddle

The vertical-align CSS property specifies the vertical alignment of an inline or table-cell element.

关于html - css 适用于输入文本而不是文本区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24944903/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com