My <textarea>
needs to fit into a space that is a percentage of the screen size, but I'm encountering some issues with different browsers. In FireFox, I am able to achieve good results by setting the CSS properties as follows:
#container { width: 70%; height:70% }
#text_area { width: 100%; height: 100%; margin: 0; padding:0; }
However, in IE 6 and 7, I am experiencing odd behavior. In IE6, the textbox seems to have padding on both the left and right sides, causing my container to expand. In IE7, the padding is only on the left side, but the right edge of the textbox extends beyond the container.
The height setting does not seem to work in either IE6 or IE7; the <textarea>
remains just 2 rows tall, ignoring the height:100% directive.
Is there a consistent way to size a <textarea>
across all browsers?
And is there a method to eliminate the left-padding on the <textarea>
?
Update
After trying position:absolute
, I was able to remove the left padding, but the width still presents an issue. IE7 calculates the 100% width incorrectly, causing the <textarea>
to spill out of its containing <div>
.
If time permits, I will create a separate example to illustrate this further...