无法在文本区域输入文本 [英] Can't enter text in a textarea

查看:81
本文介绍了无法在文本区域输入文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在消息部分输入文本.它不会让我单击并键入.名称,电子邮件和反垃圾邮件部分可以正常工作,只有textarea不能.我已经在Google上搜索了,但没有找到关于HTML textarea标签的解决方案.

I cannot enter text in the message section. It will not let me click and type. The name, email and anti-spam sections work fine, only the textarea doesn't. I've googled and found no solution in regards to HTML textarea tag.

<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 或其他所需的值.

The problem is font: inherit; which use line-height: 0px from form element. So set line-height: 1.2em to textarea or other value as you wish.

这篇关于无法在文本区域输入文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆