Centering image (folder) icons

Phoca Gallery - image gallery extension
trogladyte
Phoca Member
Phoca Member
Posts: 24
Joined: 11 Sep 2010, 04:30

Centering image (folder) icons

Post by trogladyte »

I have the center in gallery set for both category and categories as per the image. Image

The problem is, if there aren't enough images to fill the width of the gallery, then they are still left justified. (See www.tarzandesign.co.nz/portfolio).

How do I go about having the galleries fully centered regardless of the number of images? I really want the gallery to be 1200px wide (the site width).

Thanks.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Centering image (folder) icons

Post by Jan »

Hi, yes, the images are displayed in float boxes. Float boxes are left or right aligned in html/css, there is no center feature html/css.

So centering means, you can center the div over the float boxes, to really center you need to fullfill the div with images, see demo:
https://www.phoca.cz/demo/gallery-centering

The div for two images must have a width about 400px. The widt of the whole site depends on your template.

Jan
If you find Phoca extensions useful, please support the project
trogladyte
Phoca Member
Phoca Member
Posts: 24
Joined: 11 Sep 2010, 04:30

Re: Centering image (folder) icons

Post by trogladyte »

Hi Jan

Thanks for your reply. Not really what I wanted. The client I am using it for has differing numbers of galleries in each category. I DON'T want to set each gallery at 2 images wide (on a 1200px wide site that would look stupid).

Is there no way I can add/change the code by putting a div center around something?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Centering image (folder) icons

Post by Jan »

Hi, I didn't say, you should set the width for two images only. This was an example. I wanted to explain you how html/css works

Jan
If you find Phoca extensions useful, please support the project
trogladyte
Phoca Member
Phoca Member
Posts: 24
Joined: 11 Sep 2010, 04:30

Re: Centering image (folder) icons

Post by trogladyte »

OK sorry - I misunderstood your reply and the reference to the demo.

So how do I set it up so the categories are centered within the gallery regardless of how many there are? That is, I want a gallery 1000px wide, but have different categories with different numbers in them - some 1, some 5, some 9. I want those icons to be centered in the gallery.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Centering image (folder) icons

Post by Jan »

Hi, first you should know how float boxes and centering is working in html/css

Floatboxes (used in Phoca Gallery) are filling the whole site. So you need to set fixed width for your template and then set the width of phoca gallery box ( count of images you want x (image width + padding and margin) < phoca gallery width)

It is explained in this forum.

See example how the boxes are centered with css/html:

https://www.phoca.cz/documents/19-phoca- ... how-plugin

Jan
If you find Phoca extensions useful, please support the project
Post Reply