Have Three columns..Combine width of all three is fixed.. 2nd ( center ) column will have dynamic content.. I need left and right column to fill out remaining space ( container width – center column dynamic width )equally.
Example:
http://jsfiddle.net/htKje/
<div class="container">
<div class="bg"></div>
<div>Lorem Ipsum</div>
<div class="bg"></div>
</div>
CSS :
.container { width:500px; }
.bg {backgrould:#CCC; }
If you need the left and right columns just for setting the background, then most probably, you don’t even need them at all.
Simply setting the
backgroundon the.container, giving the same containertext-align: center, making the center columninline-blockand reseting thebackgroundandtext-alignon it will do the trick.demo
HTML:
CSS: