Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't enter text in a textarea

Tags:

html

css

forms

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>

This is my 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;
}

Fiddle

like image 950
Superunknown Avatar asked Mar 13 '15 11:03

Superunknown


1 Answers

You have:

button, input, optgroup, select, textarea { 
color: inherit;
font: inherit;
margin: 0px;
}

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.

like image 119
Krzysiek Avatar answered Oct 13 '22 18:10

Krzysiek