Ik kom er even niet uit: Ik wil de afbeelding uit onderstaande code in het midden van het vlak hebben staan maar dat lukt mij even niet.
Wie heeft een suggestie?
HTML-code:
<!-- Vanaf hier de content -->
<?php
$nTeller = 1;
while($rowMenu = mysqli_fetch_array($cResultFotoos)) {
if($nTeller == 1 ) {
$cClass = "box_menu_links";
}
if($nTeller == 2 ) {
$cClass = "box_menu_midden";
}
if($nTeller == 3 ) {
$cClass = "box_menu_rechts";
}
$cUrl = $rowMenu['url'];
$cAfbeelding = $cPersfotomap . $rowMenu['bestandsnaam'];
$cMenukeuze = $rowMenu['keuze'];
?>
<div class="<?php echo $cClass ; ?>">
<figure class="foto_menu">
<img class="persfoto" src="<?php echo $cAfbeelding ; ?>" alt="" />
</figure>
<p class="geelvlak_klein">
<?php
echo nl2br($rowMenu['beschrijving'] . "\r\n" . $rowMenu['onderschrift'] . "\r\n" . "Bron: " . $rowMenu['bron'] . "\r\n" . "Formaat: " . $rowMenu['formaat'] . " pixels" . "\r\n" . "Omvang: " . $rowMenu['omvang'] . " MB") ;
?>
</p>
<p class="midden">'<input type="submit" value="Download" /></p>
<div class="regelhoogte25"></div>
<p class="arial_wit"></p>
</div>
<?php
if($nTeller == 3 ) {
$nTeller = 0;
?>
<div class="clear"></div>
<?php
}
$nTeller++;
}
?>
<div class="regelhoogte25"></div>
<!-- Tot hier de content -->
De bijbehorende CSS-code:
.box_menu_links {
float: left;
width: 300px;
height: 400px;
background-color: rgb(90,25,60);
border: none;
margin-right: 50px;
margin-left: 50px;
margin-top: 50px;
}
.box_menu_rechts {
float: right;
width: 300px;
height: 400px;
background-color: rgb(90,25,60);
border: none;
margin-right: 50px;
margin-top: 50px;
}
.box_menu_midden {
float: left;
width: 300px;
height: 400px;
background-color: rgb(90,25,60);
border: none;
margin-left: 10px;
margin-right: auto;
margin-top: 50px;
}
.foto_menu {
width: 300px;
height: 190px;
border: none;
}
.persfoto {
max-width: 300px;
max-height: 200px;
}
.geelvlak_klein {
width: 300px;
background-color: yellow;
padding: 10px;
text-align: center;
font-family: Arial;
font-size: 10px;
}
.midden {
text-align: center;
margin-left: auto;
margin-right: auto;
}
George