0
Try creating lists for each image within a centralized list, then change the position of the images with left
& top
as you wish after assigning the relative position (position: relative
). According to your image it will be necessary to modify the position of the images only a few times, because they seem a little complex. When you declare left: -1px
in an image using position: relative
it will be moved 1 pixel back from its natural position. If you remove the -
(negative), your image goes 1 pixel forward from its natural position.
But if you don’t want to change the position of the images, change the vertical alignment of each one with vertical-align
. He may be top
(top), middle
(half a), bottom
(down) or initial
(pattern).
Revealing example with HTML & CSS.
CSS:
#tree {
text-align: center;
}
#tree ul {
list-style-type: none;
// Espaço entre linhas !
margin: 8px 0 8px 0;
}
#tree ul li {
/* Mostra as imagens na mesma linha */
display: inline-block;
/* Espaço horizontal entre as imagens */
margin: 0 12px 0 12px;
/* Faz a posição relativa */
position: relative;
/* Deixa as imagens alinhadas ao meio */
vertical-align: middle;
}
HTML:
(each row is a list (<ul>...</ul>
), inside the container of your tree)
(place the image or <a>
within a column <li>
in <ul>
)
<div id="tree">
<ul>
<li><img/></li>
</ul>
<ul>
<li><img/></li>
<li><img style="left: -20px; top: -20px;"/></li>
</ul>
<ul>
<li><img/></li>
<li><img/></li>
<li><img/></li>
</ul>
<ul>
<li><img/></li>
<li><img/></li>
<li><img/></li>
<li><img style="left: -20px; top: -20px;"/></li>
</ul>
</div>
You can link over the image... using css... or image map.
– Ivan Ferrer