Support » Fixing WordPress » [Plugin: NextGEN Gallery] Centering Galleries

  • the_producer


    I can’t find any help about centering galleries here, it seems everyone that posts a question about it doesn’t get an answer. Hopefully I will have better luck. Every gallery I post, the thumbs are always left, I’ve played with the CSS but cannot get them to center. Center tags on the short code are useless too. Any help? I can’t believe there isn’t a simple ‘center’ tag when adding the gallery, seems like a no-brainer…

Viewing 5 replies - 1 through 5 (of 5 total)
  • variedcelluloid


    Been looking for some help myself. I really wish for something like a basic ‘< center >’ command, that way if my gallery wraps around on a different line because someone has a smaller resolution than I use the two colums won’t be uneven. That way if you have four images, and after the third one there’s no more room to fit it on the same line it would just drop down a new line and center underneath the second of the three in the center of the page. My knowledge of CSS/PHP is so limited however, even if there is a simply fix I’m about as clueless as a bear in algebra class.

    Unfortunately the only thing I’ve been able to do is play with the ‘Width: ;’ under ‘.ngg-galleryoverview’ within the stylesheet – I set it to about %70 of the table or so until it evens out about right. However, since my layout uses the entire page and auto adjusts whenever the screen expands horizontally, I run into the same problem that once I change resolutions things look drastically different. This also only changes the thumnail box itself, and doesn’t center any of the thumbnails inside of it. So, at 800×600 I have three images side by side, and then my fourth drops a line and hangs all the way to the left instead of centering within the page.

    I wish I knew of some simple command to throw in ‘ngg-gallery-thumbnail-box’ that would float the images from left to right but also center the entire box and all of it’s contents to complete center of the table it is in. My question/page is located here if all of my 2am rambling are as incoherent as I suppose they probably are! However, if you haven’t played with that width adjustment, give it a shot I suppose. Hopefully you’ll get an answer to your question, even if it’s a “No, there is no centering!” it’ll at least be an answer haha!



    +1 for a solution to this. 🙂

    I too have been pulling the gallery css apart via FF & Firebug – I’ve centered many an item via <margin: * auto * auto;> but no matter how I tweak the cascade those little thumbnails won’t center. I wouldn’t think I’d have to hack the nggfunctions.php file just to center some thumbs.

    where the where it’s getting that “float left” from, but so far I can ‘t see it – Firebug sure as heck can’t see it.

    Shouldn’t really be that hard



    frustrating because the native wordpress gallery system only inserts this nugget of code:

    <style type='text/css'>
    .gallery {
    margin: auto;
    .gallery-item {
    float: left;
    margin-top: 10px;
    text-align: center;
    width: 33%;
    .gallery img {
    border: 2px solid #cfcfcf;
    .gallery-caption {
    margin-left: 0;

    then marks the thumbs accordingly to text-align for center. neither that nor the margin for auto seem to work for NextGEN though.

    Alex Rabe


    the native gallery works with page breaks <br /> so it’s not compare able to the NextGEN solution. Please look for my reply here

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: NextGEN Gallery] Centering Galleries’ is closed to new replies.