You can do this with display: table; and table-cell;
You must provide the #main CSS shell display: table; and its children are table-cell; . And you have to move the markup div.right after div.left
<div class="left"> <div class="block">Block1</div> <div class="block">Block2</div> <div class="block">Block3</div> <div class="block">Block4</div> <div class="block">Block5</div> <div class="block">Block6</div> </div> <div class="right">Content</div>
You can adjust the width of the blocks to whatever you want, 100%/6=16% , so I used 16%. If you need dynamic width, you can leave a width declaration and they will automatically change to all available. This mimics the behavior of a table, but is still semantic markup.
#main { width: 100%; display: table; } .right { display: table-cell; width: 200px; height: 300px; background: #888; } .left { overflow: hidden; height: 300px; background: #ccc; display: table-cell; } .block { width: 16%; height: 50px; float: left; border: 1px solid blue; display: table-cell; }β
http://jsfiddle.net/Kyle_Sevenoaks/7sp5M/31/
source share