My layout for
http://www.decibel.ws/gallery requires that the photos on the individual image pages be centered. I am able to do this for the horizontal photos with CSS using min-width, max-width, and right/left margins set to auto.
`.image {
min-width: 462px;
max-width: 612px;
margin: 0px auto 0px auto;
}
.image img {
min-width: 450px;
max-width: 600px;
padding: 5px;
border: 1px solid #BFBF82;
}`
However, vertical images are still aligned to the left side of the max-width setting. I'm rather stuck. Anyone who wants to take a look at this with fresh eyes would be greatly appreciated.
Comments
Anyway, you can try setting margin-left:auto and margin-right:auto instead of the margin: in the .image class. See what that does. That usually works for me.
Let me know if that helps.
`.image {
width: 462px;
margin: 0px auto 0px auto;
}`
Sadly, I can't use it because it would mess up all my horizontal photos. Any more ideas?
what you've got (from looking at your site), is a div main, then an image div, then within the image div is the a tag and then the img tag. the a tag looks like it has no style associated with it, and the height and width is auto. this may be what is presenting an issue for your style.
see what happens if you do a margin-left:auto and margin-right:auto on the a tag instead of the img tag, since the a tag "surrounds" the img tag
Let me know, and I can help you further.
`.image {
text-align: center;
}
.image img {
min-width: 450px;
max-width: 612px;
margin: 0 auto;
padding: 5px;
border: 1px solid #BFBF82;
}`