Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Very simple : textarea with min height-rows and 100% height?

Tags:

html

css

I have a div containing a textarea element.
And I need to give it the right vertical size.

The container Div have right size. (100%)
I want to give a min-height or min rows, to provide a scroll if necessary, and a height of 100% (the 100 % of div).
I can't. I don't know how to do this. I need an example.

like image 572
tonnot Avatar asked Jul 20 '13 10:07

tonnot


1 Answers

The very basic example is

<html>
<body>

<div style="height:100%;border:1px solid green;">
    <textarea style="min-height:100px;height:100%;width:100%;border:1px solid red;"></textarea>
</div>

</body>

Borders are only to show dimensions. But in your case it might be more complicated. Please look at the definition of a containing block and height calculation.

like image 129
twil Avatar answered Oct 01 '22 04:10

twil