views:

386

answers:

1

How do I get my <textarea> to have a height of 100% and work in IE7/6? height:100% works fine in all other browsers but IE just doesn't want to accept anything other than specific values. Javascript is a possible solution.

+2  A: 

In order for an element to achieve 100% height in IE6, you will need to specify a fixed height of its parent element. If you want to make the element the full-length of your page, apply height:100%; to both the html and body elements.

/*100% height of the parent element for IE6*/ 
#parent {height:500px;}
#child {height:100%;}

/*100% of the page length for IE6*/ 
html, body {height:100%;}
#fullLength {height:100%;}

Taken from: http://www.virtuosimedia.com/

I'm guessing the same applies for IE7.

Jonny Haynes
This applies to divs though, not textarea. I have tried that.
Louis
Can't you wrap the `<label>` that's associated with the `<textarea>` around it and apply the parent styles to it?
Jonny Haynes