我无法在消息部分输入文本。它不会让我点击和输入。名称、电子邮件和反垃圾邮件部分工作正常,只有文本区域没有。我用谷歌搜索并没有找到关于 HTML textarea 标签的解决方案。
<form method="post" action="email.php">
<label>Name</label>
<input name="name" placeholder="Type Here">
<label>Email</label>
<input name="email" type="email" placeholder="Type Here">
//this is the problem
<label>Message</label>
<textarea name="message" placeholder="Type Here"></textarea>
<label>*What is 2+2? (Anti-spam)</label>
<input name="human" placeholder="Type Here">
<input id="submit" name="submit" type="submit" value="Submit">
</form>
这是我的 CSS:
.contact-form input[type=text],
.contact-form input[type=password],
.contact-form input[type=email],
.contact-form textarea,
.contact-form input[type=file] {
display: inline-block;
float: left;
padding: 12px 15px;
width: 100%;
border: 0;
border: 1px #DFDFDF solid;
background: #fff;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.contact-form textarea {
clear: both;
width: 100%;
height: 180px;
resize: none;
}
最佳答案
你有:
button, input, optgroup, select, textarea {
color: inherit;
font: inherit;
margin: 0px;
}
问题是 font: inherit;
使用 form
元素的 line-height: 0px
。因此,将 line-height: 1.2em
设置为 textarea
或您希望的其他值。
关于html - 无法在文本区域中输入文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29031417/