Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 07h 30m 39s
Claim 50% off
Staff replied SP Page Builder

How to center a button

Asked by Amar Guillen 1 year ago Last activity 1 year ago

Hello there,

It could sound like a stupid question but how to center a button?

Here is the test page I work on : https://gpfa99.guillenphoto.com/fr

Scroll down until you find the button labelled 'Button'.

I created a section, a center flex div and the button inside.

I am not able to center it on the page. Please would you help me?

Thanks for your help
Sincerely,
A. Guillen

10 replies

Paul Frankowski Senior Staff

Hi Amar,

in general, there is option to center Button addon, just scroll settings below "Button Style".

info_2894_2025.gif

Paul Frankowski Senior Staff

Of course using Custom CSS, you can add the same center effect.

If we talk about button with label "Button >"

#sppb-addon-wrapper-ba6abc6f-29db-4990-878f-5198b6bcdee7 {
  text-align: center;
  margin-bottom: 15px;
}

But addon settings in most cases works just fine.

Amar Guillen Asked this

Thank you very much Paul,

it works.

Do you know why I should add this css?

Paul Frankowski Senior Staff

To be honest I have no idea, becuase in 99% cases, addon settings just work fine.
It can be problem from Template as well.

Make a quick test (3min):

  1. Create a new page, add new Section.
  2. Add Button addon, set it to display on the middle (center aligment)
  3. Preview page
  4. Then change Template from current to Casiopea - make it default for 60sec
  5. Preview page again
  6. Then set your extra template as default again.

Maybe if you would share access I can check it. But first do my test with all steps.

Paul Frankowski Senior Staff

You used only settings, no extra CSS, right?


I think, I may know, You enabled Production mode in SPPB settings, it keeps old settings, like cache.

Please go there and click Clear, it will reload CSS.

Amar Guillen Asked this

Thanks.

It is not working. The button is on the left.

Paul Frankowski Senior Staff

Hopefully with extra CSS worked on mentioned page, so keep this way.

Next time, just share access, I will check deeper.

Amar Guillen Asked this

Hi Paul,

I am back to you because I am trying to update my production website and it is not working with the css you gave me yesterday for my test website.

Please would you check my production website in French: https://www.guillenphoto.com/fr/ ?

Scroll down to the button labelled "Découvrir les galeries photo >". The button is located on the left. I would like it centered.

Would you give a permanent solution because I am going to create the same button on the English version of my website. It is another spbuilder page.

Thanks for your help

Sincereley,
A. Guillen

Amar Guillen Asked this

Hi Paul,

I found the way you gave the correction. I am not a developper but sometimes, I use Chrome Console to find out.

I copied the div id of the wrapper and it works.

But it is not satisfaying. How can I avoid that trick?

Thanks

Amar Guillen Asked this

Hi Paul,

I found a permanent solution that works well.

I created a module and the result is what I want.

Thanks for your help

Sincerely,
A. Guillen

Paul Frankowski Senior Staff

This is also good solution, also becuase that same addon (module) you can use multiple times.

Log in to reply.