Sunday, 15 June 2014

html - Centering a div fed by dynamic content -



html - Centering a div fed by dynamic content -

so, have this:

<div> <img src="img1.jpg"> <img src="img2.jpg"> <img src="img3.jpg"> </div>

i want centered horizontally browser window, if insert more images div. (so, no fixed width div size) solution found div{text-align: center;}, doesn't seem right, img tags aren't text.

is there other solution?

change html like:

<div class="container"> <img src="img1.jpg"> <img src="img2.jpg"> <img src="img1.jpg"> </div>

then add together in css:

.container { margin:0 auto; }

this move whole container in center of site.

html css

No comments:

Post a Comment