I want to create a fixed layout that displays some images. for example, a "table" of 3 images in a row and 3 images in a column. Also i need that every li conatins some fixed width and height and the image centered and alignet to top.
So i've thinked in something like this:
<ul>
<li><img /></li>
<li><img /></li>
<li><img /></li>
</ul>
<ul>
<li><img /></li>
<li><img /></li>
<li><img /></li>
</ul>
<ul>
<li><img /></li>
<li><img /></li>
<li><img /></li>
</ul>
But i don't know css, still i've created some like this but still doesn't work...
ul {display: block; text-align: center; border:#666666 solid 1px; height: 150px; padding:0; margin:0;}
li { list-style:none; float:left; width: 150px; height: 150px; margin-bottom: 32px;}
Fixed version:
ul{ height: 180px; text-align:center;padding:0;}
li{list-style:none;padding:0;width: 25%;height: 180px;float: left; display:inline-block;}
Note: Only works for only one <ul>
with many <li>
, the columns are setted changing the width of the <li>
. 25% means 4 columns, 33% = 3 columns, etc. Formula: 100/(desired columns).