Ik zit met een vervelend probleempje.
Ik ben bezig aan een photoalbum en zou een image moeten centraliseren op de pagina.
Helaas blijft hij steeds links staan. Ik heb me al rot gezocht maar zonder resultaat.
Mijn HTML:
<div id="photoDiv">
<div id="photoNavigatorDiv">
<div class="photoNavigation"><a href=<?="?page=fotos&album=".$_GET['album']."&photo=0"?>>First</a></div>
<div class="photoNavigation"><a href=<?="?page=fotos&album=".$_GET['album']."&photo=".($_GET['photo']-1)?>>Previous</a></div>
<div class="photoNavigation"><a href=<?="?page=fotos&album=".$_GET['album']."&photo=".($_GET['photo']+1)?>>Next</a></div>
<div class="photoNavigation"><a href=<?="?page=fotos&album=".$_GET['album']."&photo=".(count($fotos)-1)?>>Last</a></div>
</div>
<div id="photoBox">
<img src=<?=$fotos[$_GET['photo']]->getImage();?> />
</div>
<div style="clear: both;"></div>
</div>
Mijn css:
#photoDiv {
margin: 0 auto 0 auto;
position: relative;
width: 80%;
height: 100%;
border: 1px solid black;
}
#photoNavigatorDiv {
position: relative;
width: 100%;
height: 50px;
margin: 0 auto 0 auto;
}
.photoNavigation {
position: relative;
float: left;
font-size: 15pt;
font-weight: bold;
text-align: center;
width: 25%;
height: 50px;
}
.photoNavigation a {
display: block;
padding: 10px;
}
.photoNavigation a:hover {
}
#photoBox {
position: relative;
float: left;
border: 1px solid red;
min-width: 20%;
margin: 0 auto 0 auto;
}
#photoBox img {
margin: 0 auto 0 auto;
}
(let niet op de borders, dat is maar om te zien hoe hij het juist zet. Deze gaan uiteraard weg)