I have a
div (.container) of variable width containing 2
divs. The right
div (.div-submit) is of variable width, depending on the language used. I want the left
div (div-textarea) to adjust and take all the remaining space on the left. How can I achieve this without using flexboxes? See code below and this jsfiddle
<div class="container"> <div class="div-textarea"> <textarea id="txtarea" placeholder="This is a textarea"></textarea> </div> <div class="div-submit"> <input type="submit" value="Post"> </div> </div>
Please note that the right
div does not have a fixed width, so solutions like
this one does not work.
I removed the
float:left; from your textarea div and added
overflow:hidden;. I have also repositioned the submit div in the HTML so that it is placed before the textarea div. It seems to work fine.
This recipe can be found in it's original form on Stack Over Flow.