• Resolved Reppiks

    (@reppiks)


    Greetings WordPress fam. I am having a problem trying to center my galleries on this them. My code in the editor looks like this;

    <div style=”text-align: center;”>

    [gallery columns="4" link="file" ids="1,2,3,4,5,6"]

    </div>

    This has worked on websites I’ve designed before. It also centers on other themes. I noticed when I look at the output code via “inspector” that the code isn’t blocked by any other CSS and trying different centering methods doesn’t produce any results.
    Any ideas on why this would be happening or how to resolve it?

    Reference to pages that aren’t showing centered galleries:

    https://reppiks.com/services/graphic-design/
    (The gallery under “view our work” on this page)

    https://reppiks.com/services/web-design/

Viewing 3 replies - 1 through 3 (of 3 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hello reppiks,

    Try below code


    <div style="text-align: center; margin: 0 auto; width: 72%">

    [gallery columns="4" link="file" ids="1,2,3,4,5,6"]

    </div>

    Hope this will helps you.

    Thread Starter Reppiks

    (@reppiks)

    Thanks AddWeb! Yes that seems to do the trick. It was a lot of help. I forgot all about being able to use percentages now. I was tryiing pretty much that same code with “max-width” set but it wasn’t that responsive.

    How did you come up with 72%!!? Anything more or less breaks the centering smh.

    Theme Author CyberChimps

    (@cyberchimps)

    Hi,

    Thanks for the reply @addweb-solution-pvt-ltd

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t Center Galleries’ is closed to new replies.