Tutorial :CSS, auto resize div?



Question:

I'm trying to design a layout with css, I got one main container(div) and two inner container(div_upper and div_lower). let say I want to resize div_upper and div_lower will automatically resize itself and both divs still fit in the main container. I'm sure this can be done in javascript, but is there any CSS to accomplish this? if so I would be glad.


Solution:1

Maybe this blogpost on the A List Apart website will help you in the right directions.


Solution:2

Another solution:

Use this class for getting auto vertical height -

.getAutoHeight {     position: relative;     overflow: auto; /* edit by thobens: overflow: hidden seems to be better, as (at least) IE 8 shows always a disabled scrollbar with overflow: auto */  }    <div class="getAutoHeight ">      any content<br />      any content<br />      any content<br />      any content<br />  </div>  


Solution:3

CSS3 resize:

.thisDiv {resize:both;}  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »