我想增加输入框的高度,以便我的占位符文本换行并且完全可见阅读。但是,我的 css 似乎不起作用!有什么想法吗??
这是屏幕名称的 hmtl5
<tr>
<th class='row_header requiredfield'>Screen Name*</th>
<td><input class="large_width tall_height" id="screen_name" type="text" name="screenname" value="{{screenname}}" placeholder="Put in a name others can understand if you don't want to use your actual name."/>
</td>
</tr>
这是 CSS:
.large_width {
width:250px;
height: 25px;
}
.tall_height {
height: 50px;
}
input {
font-size: 14px;
font-family: "Helvetica Neue";
}
input[placeholder] {
font-size: 11px;
}
最佳答案
使输入的高度和占位符的行高相同。 例如
CSS:
.input-class
{
height:30px;
}
.input-class[placeholder]
{
line-height:30px;
font-size:22px;
}
关于html - 如何增加输入字段的高度,以便占位符文本完全显示在输入框中 HTML5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17608991/