Forum Moderators: not2easy

Message Too Old, No Replies

Center div with multiple images

         

Mikimauzas

8:37 pm on Feb 2, 2011 (gmt 0)

10+ Year Member



Hey guys, I have a small problem with image positioning on my website. Now images in a post look like this: <snip>. How to align them to center like that: <snip>?

[edited by: alt131 at 5:39 pm (utc) on May 17, 2011]
[edit reason] Thread Tidy [/edit]

alt131

9:57 am on Feb 3, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Mikimauzas and welcome to WebmasterWorld [webmasterworld.com]

If I understand correctly, the left-most image is aligned with the left column edge, but you want the block of three images to appear "centred". A solution is difficult to suggest without seeing code, but I wonder if the three images are wrapped in a container, for example:
<div>
<img src="image1">
<img src="image2">
<img src="image3">
</div>

If so, centre the outer container by setting a width and the left/right margins to auto:
div {width:90%; margin:0 auto;}