Support » Theme: Responsive » Can’t Center Galleries

  • Resolved 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"]


    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:
    (The gallery under “view our work” on this page)

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


    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"]


    Hope this will helps you.

    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



    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.