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>
Monday, October 8th 2007
— Dominic Szablewski, @phoboslab
38 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!!!!!
I hereby award this page and those taking part in it 1,000 intarnets.
Frakking IE. I am sorely tempted to write a virus that quietly removes IEXPLORE.EXE, then downloads a themed version of Chrome that looks exactly the same to replace it.
Great fix. If you hide the border of the textarea and let the fieldset be your border, it works nearly perfect like the textarea itself.
Thx
Doesn't work at all for me. After adding those wrappers, the textarea block goes past the fieldset. But it's not a problem, I'll use the cols/rows attributes instead.
It didn't work for me :( I have a table with 2 columns and in each I have a textarea, when you write on the one on right side it expands and cause the left one to becomes smaller, is there any suggestion?
Thanks man.
Have a nice day.
How is that not a "dirty hack"?
Big thanks for that great hack - I search even more then one hour for a solution!
THANKS
thx
Big thanks for the information! It saved me an awful lot of hours debugging my application. The solution is applicable to older browser versions such as IE5 (I know medieval times).
Suffering the same problem with an iframe in ie8 :@
Thanks Man.. Really helped.
Thanks lad, still had this issue with Internet Explorer 11. However it was enough to wrap the <textarea> in a <div> only to solve it, omitting <fieldset>.