html - Textarea stretches parent div -


i trying display textarea inside fixed div.

my code here http://jsfiddle.net/uy5b6/7/

you can see textarea stretches out div. want textarea fill div, not stretch it.

use negative top margin textarea.

div.modal {     position: relative; /* show above textarea */ } div.modal textarea {     margin-top: -24px; /* equal 'close' height */     padding-top: 24px; /* equal 'close' height */     -moz-box-sizing: border-box;     box-sizing: border-box;     width: 100%;     height: 100%; } 

now can add borders match style.

you can apply following css.

div.modal {     position: relative;     z-index: 1; /* show above textarea */     display: block;     text-align: center; } div.modal textarea {     position: absolute;     top: 0;     padding-top: 24px; /* equal 'close' height */     -moz-box-sizing: border-box;     box-sizing: border-box;     width: 100%;     height: 100%; } 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -