[SOLVED]Lightbox in Gallery thumbnails

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
vicpug
Forum Members
Forum Members
Posts: 22
Joined: Mon Jul 12, 2010 1:58 pm

[SOLVED]Lightbox in Gallery thumbnails

Post by vicpug »

Hi,  

Gallery is a great module and works well with square thumbs. I am trying to use the Lightbox template to display nonsquare thumbs and vertically centre the thumbs, but I have had little success with the supplied CSS. Has anyone had any luck on how to do this.  many thanks
Last edited by vicpug on Sun Aug 29, 2010 1:50 am, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Lightbox in Gallery thumbnails

Post by Jos »

If you Google on vertical align with css you will find it is very hard... I myself don't know a way to accomplish this
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Lightbox in Gallery thumbnails

Post by Dr.CSS »

A link to the site would help...
vicpug
Forum Members
Forum Members
Posts: 22
Joined: Mon Jul 12, 2010 1:58 pm

Re: Lightbox in Gallery thumbnails

Post by vicpug »

nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am

Re: Lightbox in Gallery thumbnails

Post by nicmare »

you could use backgroundimages with background-position:center center; instead of using tags.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: Lightbox in Gallery thumbnails

Post by JohnnyB »

Here's the very simple CSS needed to do this.
.gallery {
text-align:center;
}
.gallery .img {
display:inline-block;
margin:10px auto;
max-height:240px;
vertical-align:middle;
}
.gallery .img a {
border:2px solid #DDDDDD;
display:block;
margin:0 10px;
padding:1px;
}
.gallery img {
border:medium none;
}

Note:
for IE6 you will need the following CSS ruleset in a conditional comment:
.gallery .img {display:inline;zoom:1}/* this will force IE6 to respect display:inline-block and show the correct vertical alignment */

Note:
You have two declarations on that page. Actually it is an entire extra html document inside of the template.  You will need to clear up those errors.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
vicpug
Forum Members
Forum Members
Posts: 22
Joined: Mon Jul 12, 2010 1:58 pm

SOLVED

Post by vicpug »

Many thanks to all who helped. The CSS changes appear to work a treat.  All is good.  cheers
Post Reply

Return to “Layout and Design (CSS & HTML)”