Bulvak
Bulvak

Reputation: 1804

html form textarea formatting in different browsers

There is this form I have and I would like the description field to be a textarea with the text box having the blue div as its background. I can adjust the rows and columns but problem is in google chrome it works but firefox it adds 2 extra rows which prevents me from fitting the textarea in the div properly...Any idea on what I can do about this?

http://jsfiddle.net/MwnSn/12/

Upvotes: 0

Views: 481

Answers (2)

Arnaud Le Blanc
Arnaud Le Blanc

Reputation: 99929

You can style textareas with css width and height:

.the-blue-background {
    width: 300px;
    height: 300px;
}
.the-blue-background textarea {
    height: 100%;
    width: 100%;
}

Try it here: http://jsfiddle.net/MwnSn/14/

Upvotes: 1

Curtis
Curtis

Reputation: 103428

Rather than specifying cols and rows, use CSS to specify height and width

You are a lot more likely to get a cross-browser result with this method.

Upvotes: 3

Related Questions