Page 1 of 1
Get portrait image also centred
Posted: Wed Feb 15, 2012 8:28 pm
by Robbedoesie
Hello,
in the image gallery i am trying to position the images. The landscape images are positioned well butt the portrait images are not.
How can i position also the portrait images well without losing the caption? I of course tryed to position the images, but sometimes the caption moved to the side of the image or in the image itself.
This is the image gallery;
http://www.robcnossen.nl/uploads/gallery.php
Thanks,
Robbedoesie
Re: Get portrait image also centred
Posted: Fri Feb 17, 2012 5:12 pm
by jacek
You should be able to centre them by setting their margin to auto
img {
display: block;
margin: 0px auto;
}
Re: Get portrait image also centred
Posted: Sun Feb 19, 2012 9:59 pm
by Robbedoesie
Of course it is working. Thanks for your answer.
I have done that before, the margin:0 auto, and the images moved to almost outside of the screen. I thought, that is not the middle of the image container, but after i gave the container a border i saw that the container was much bigger than i thought.
It is better for me to give the container a border and then experiment with it. I have seen that i am using the container wrong for what i want to achieve.
I gonna experiment further with this. Hopefully with success, if not i come back to your forum.
Re: Get portrait image also centred
Posted: Wed Feb 22, 2012 10:09 pm
by Robbedoesie
I figured it out how to get the image with the caption on the place where i want the image and caption by using the following code;
#imagecontainer{
width:60%;
float: left;
position:fixed;
margin-left:29%;
top:19%;
}
#image {
display:table;
margin-left:auto;
margin-right:auto;
}
I placed a div container(#imagecontainer) outside the div container(#image) with the images and captions are showing up and then i could center the images.
It works in Firefox but not in Internet explorer. There the captions is not under the images but on the right side of the image. After trying to get the caption under the images somehow the portrait images are again not on the position where i want them to be.
Internet explorer 7 does not support display:table; but how can i get this also working in internet explorer?
Thanks
Re: Get portrait image also centred
Posted: Thu Feb 23, 2012 11:25 pm
by jacek
Robbedoesie wrote:Internet explorer 7 does not support display:table; but how can i get this also working in internet explorer?
You don’t really have to anymore, IE7 is old
But There are lots of people asking this question
http://www.google.co.uk/search?hl=en&q= ... paly+table