Wie zentriere ich die div-Elemente? Sie schweben nur nebeneinander, aber nicht zentriert.float left div container center
Die div-Elemente enthalten alle ein Bild fester Breite, unter dem Bild erscheint ein variabler Text.
<div id="wrapper">
<div style="max-width:900px;margin: 0 auto;">
<div style="width:100%;">
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
<div style="float:left;"><img src="img" width="250" height="150" ><br>This text goes under the Picture.</div>
</div>
</div>
</div>
#wrapper{
margin: 0 auto;
width: 900px;
max-width: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
Vielen Dank.
Mit freundlichen Grüßen
funktioniert auch wie ein Charme, vielen Dank! –
@MarcoVeLi genial, kein Problem :) –