Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get textarea to take up 100% of remaining space?

Tags:

html

css

I have a div with the following structure:

<div class = "card">
   <div class="menu">
      vertical menu here, pushed to the left
   </div>
   <div class ="content">
      <textarea> This should fill up everything in the card exept the menu div</textarea>
   </div>
</div>

I'm trying to get the 'textarea' to fill up the entire card while leaving the menu there. My jsfiddle shows it a little too wide and pushed to below the card div for some reason:

http://jsfiddle.net/PTSkR/105/

How can I get that textarea to fill up the remaining card space?

like image 554
SB2055 Avatar asked Nov 03 '22 21:11

SB2055


1 Answers

If you want something like this: http://jsfiddle.net/PTSkR/107/ ,

you can achieve it by using float:left for the menu, float:right for the textarea, and CSS3 Calc for calculating textarea's width, as in the example

like image 122
Andrea Ligios Avatar answered Nov 09 '22 10:11

Andrea Ligios