I am creating a two-column layout by having one div floating left (with a width of almost 50%) and another div floating right. Inside these divs I am displaying a textarea. This works fine in principle and nicely adjusts the width of the columns to the available width.
However, when someone uses the browser's textarea resizing function (e.g. in Firefox) to change the size of the textarea, the div does not adjust. The result of this is that the text area is resized, but extends outside the div (or just becomes cut off).
Can I fix this somehow?
MWE:
<div style="overflow: hidden;">
<div style="float: left; width: 40%; background: red; padding: 1em;">
<textarea style="width: 100%">left</textarea>
</div>
<div style="float: right; width: 40%; background: green; padding: 1em;">
<textarea style="width: 100%">right</textarea>
</div>
</div>