Center button - Post ID 271077

User 473299 Photo


Registered User
144 posts

How do I center an inline-block BUTTON within a column?

Regards, Linda
User 515127 Photo


Registered User
116 posts

Hi Linda,

Assuming that the button is the only element within the column, probably the simplest way would be to change the column display parameter to flex and then set the justify to center.

Hope this helps,
Gordon

Linda Menkhorst wrote:
How do I center an inline-block BUTTON within a column?

Regards, Linda
User 187934 Photo


Senior Advisor
20,271 posts

Another way. Set the button to display Block and use margin auto.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 434929 Photo


Ambassador
938 posts

Linda Menkhorst wrote:
How do I center an inline-block BUTTON within a column?

Regards, Linda


https://i.imgsafe.org/c4b2031796.gif

For better quality click and see following link

https://media.giphy.com/media/3oKIPd5Xs … source.gif

Guys at coffeecup are awesometacular.
User 473299 Photo


Registered User
144 posts

And how if I have two buttons inline?
User 2699991 Photo


Registered User
5,400 posts
Online Now

Linda Menkhorst wrote:
And how if I have two buttons inline?


set the column/container holding the buttons to

Position Display = Flex

Direction = row (or column later at smaller widths (if needed)
wrap = no-wrap
justify = space around

items = center
content = stretch

then set l/r margins for each button to "Auto"

if you change direction to column later you may need fiddle with flex or block for the column/container (depending on width of buttons,,

Just open a new blank project and insert two buttons into a column/container and play with flex for a bit,,, once you have got it,, just close the project without saving and get into your real project & just do it,, no damage or harm done to your original project
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/index.html
User 473299 Photo


Registered User
144 posts

Thank you all.
I used the method of Mansour, thank you, so easy, but didn't see it before.
I will start experimenting with Flex, thank you Wayan.

Regards, Linda
User 434929 Photo


Ambassador
938 posts

Linda Menkhorst wrote:
And how if I have two buttons inline?


same method as above demo
Guys at coffeecup are awesometacular.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.