jquery - Div center issue -
i have main container 940 pixel
with 2 divs inside main container of width 250px each
i want these boxes centered align main container. issue second div dynamically adds. in case second div not there first 1 should center. , when second div added both should cenetered per 940 px main div.
i tried lot not solution. please help!
here simplified code
css
div.box { background: #eee; height: 400px; width: 940px; } div.left { background: #999; float: left; height: 390px; width: 250px; } div.right { background: #666; height: 390px; width: 250px; float: left; } div.clear { clear: both; }
html
<div class="box"> <div class="left">tree</div> <div class="right">view</div> ( div dynamically add) <div class="clear" /> </div>
thanks
Comments
Post a Comment