html - Once more: adjusting div to another divs height (dynamically)? -
so here question once again adjusting divs height another. found lot of questions , answers this, can't seem make work. therefore asking once again.
the problem: have 2 divs , heights differ. i'd have height of div x adjusted heighest (other) div. i'd happen without javascript, since i'd compatible resizing browser screen , don't want need use resize function time detect screen size (hope makes sense).
so here code: http://jsfiddle.net/frlt1vmn/
<style> #container2 { margin: 10px auto; width: 927px; } #leftcol2{ float: left; width: 195px; background: #fcf; z-index:-1; padding:0; margin:0; } #rightcol2{float:right; width:732px; background: #cff; z-index:1; padding:0; margin:0; } </style> <div id="container2"> <div id="rightcol2"> how adjust divs automatically height of other. </div> <div id="leftcol2"> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> <p>in example div heigher.</p> </div> </div>
thank helping out!
edit call rightcol2 div first because of responsiveness. see here: http://jsfiddle.net/azl9uefv/
see fiddle solution http://jsfiddle.net/frontdev111/sm6xqqyw/
i have done changes in html , css.
you need use display:table
parent container , display:table-cell
child containers.
let me know if have trouble this.
Comments
Post a Comment