Menu
I want to make 6*6 grid and each cell has one button .There should be no spaces between buttons horizontally or vertically.How to make this layout without using tables.
Thanks
[code=html]<div id="sixBysix">
<img alt="1" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="2" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="3" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="4" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="5" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="6" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<div style="clear:left;"><!-- clearing left-float --></div>
<img alt="1" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="2" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="3" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="4" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="5" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="6" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<div style="clear:left;"><!-- clearing left-float --></div>
<img alt="1" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="2" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="3" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="4" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="5" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="6" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<div style="clear:left;"><!-- clearing left-float --></div>
<img alt="1" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="2" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="3" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="4" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="5" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="6" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<div style="clear:left;"><!-- clearing left-float --></div>
<img alt="1" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="2" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="3" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="4" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="5" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="6" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<div style="clear:left;"><!-- clearing left-float --></div>
<img alt="1" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="2" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="3" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="4" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="5" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<img alt="6" src="#" style="width:80px; height:30px; float:left; border:1px solid gray;" />
<div style="clear:left;"><!-- clearing left-float --></div>
</div>[/code]
d17may, even though WebJoel uses inline styles in his demo, in a real site you should use an external stylesheet instead.
WebJoel, why the clearer <div>s? Why not give a class to every 6th <img> to clear the others and make a new row?
ray326, why? Floated elements are automatically given display:block;.[/QUOTE]
Apparently what I was suggesting doesn't work in IE7 and many other older browsers.
That being the case, using a <div> to clear the <img>s is fine, WebJoel.[/QUOTE]
0.1.9 — BETA 6.1