IE Textarea 100% Width Bug
I recently finished work on tinyprice.de, an online community for exchanging coupon codes. The programming part was not a problem at all – just simple database I/O etc. – the layout however was quite a challenge.
Of course, the only browser making problems was Microsofts IE6. It was quite a struggle, but in the end I managed to work around every bug, without using any dirty hacks.
One particular problem I encountered, was a textarea for user comments, that had a width: 100% style. In IE6 it always spanned over the whole page, not only over the parent element. The solution I found after a lot of research, was quite simple: just wrap the textarea in a fieldset AND a div element, and everything works fine again:
<fieldset>
<div>
<textarea style="width: 100%;" name="content"></textarea>
</div>
</fieldset>

26 Comments:
stuck with same problem. thx 4 solution.
great, thanks, looked all over for this
I tried it before with just a <fieldset> wrapping a <textarea> but it didn't work. Using BOTH <fieldset> and <div> really fixes the bug. Burn IE, burn!
Same here...the div makes the difference. Also...it helps to set the fieldset's margins and borders to 0 (at least in my particular case).
thanks for the solution
I dont link designing since we need to optimize for the IE, if the IE wasnt there programming might be fun
It took me a day to work around.
Thanks for your solution.
This did the charm, it did take a while to find - needs to be at the top of Google!
Thank you a lot!!!!! for your solutions!
I've wrote little JS to fix it, but it falls down when I resize window (in ie6 only :-D)
I am really sick of the problem, when website works all well on any other browser on this planet except internet explorer, IE sux when it comes to rendering page content. and your fix works all well thanks a lot.
Moin, I can understand you. I hate IE as well. If not so many uninformed people out there who use IE 5/6/7/8 I would never bother myself to hack HTML code to support it. But the reality is that webmasters still have to consider IE6 as a popular browser and support it. :(((
Internet Explorer Beta also seems to have similar problem.
Read more at this Link:
www.setforever.org/blog/2008/internet-explorer-8-beta-2-bug-text-fields-content-issue/
Cheers mate! Worked a treat!
Great! Great! Great! Thanks to you I will not be spending my afternoon fixing this!
Does not work for me :/
Ugh - it /works/, but it messes with my DOM!
Am I bitter enough to exclude anyone who uses IE from my site? I'm seriously thinking on it...
I was stumped on this for a site I am building. Stupid IE.
Great fix though!
Good!
Thanks~~
you rule!
My problem was a
with relative width (100%) would continually resize width as the user typed in it. Annoying. But wrapping it in a fixed it all upThat ended a two hour search for a workaround... thanks!
You're a genius!
You star! Dont need the divs by the way
WICKED COOL!!!
Thanks a lot! It is genius!
On the my page textarea changed size when I typing! :crazy:
This solution helped me!!!
Good one. Thanks a lot.
Cool!!!!!
Post a Comment: