I’ve been building a few landingpages with a copy of the default HS template. Works very good, except I can’t figure out for the world how to make the buttons center align within a column. They always stick to the left. I’ve been looking in the settings > themes part, I’ve been through the CSS code, but nothing worked. Anyone got a sugestion?
A good example of this is https://samenrisicobewust.schoutenzekerheid.nl. De page is in dutch, but when you scroll down you can see that the last button is aligned quite akwardly. Hope you be able to put me in the right direction!
Nevertheless - If you plan to build multiple pages with a CTA section as the last element and would like to always center it you could do it a bit more generic like this:
Also: @dennisedson idea of putting a justification option to the button is great since it’s a “cleaner” solution but requires a bit more work. But I’ll try to guide you. Since you’re using the “session”-theme you’d need to:
find the button.module of your theme(most likely located in the modules folder of your theme in the design-manager).
modify it
First I would add a select option (can be found in the right-sidebar) for simple handling in the future I would add a select option and give it following values/names
Name of select option(very top in the right sidebar): Button position
- name: Left / value: flex-start
- name: Center / value: center
- name: Right / value: flex-end
copy/paste the code below
save the button
go to your page and select the option where you’d like to position of the button
Hi both! Thanks for your help! I think this is the solution. @Anton can you please tell me what code I need to replace, or where to put the code above? I managed to add the justification option to the buttons, but they’re obviously not yet working.
Thanks for this solution, I’m new to Hubspot and it worked great. I had trouble finding the “select option” in step 2 (perhaps it was renamed). Adding clarity to step 2.1 of the answer:
In the “Fields” section, click “Add field”
Select “Choice”, located under the Boolean label
Proceed with the rest of step 2
Another note: these instructions add a selector dropdown to the Button module UI. They do not add the “Alignment” button group that’s in the Styles tab of other modules—see screenshot for reference. I named my field “Button alignment” to match the labeling pattern of the other options.
Hi Anton,
I have tried this for the center button. Though it does create a centered button, the text is no longer centered and aligned to the left. I added the justification section as described above but that does not seem to do anything. Can you please provide an update if this still works?