Bootstrap Offset Not Working as Intended

Hello all,

I’m having a issue centering a Form + Button I have nested inside a Bootstrap Col.
Currently, I have the column size as sm-8 with an offset of sm-2 on each side (summing to 12 on the grid).
I thought this would let me center the column on the page.
Maybe the display: inline-block if affecting the positioning behavior?
I’ve hacked at for a while to no avail:

Thanks in advance for the help, I’m sure it’s a concept I’m not understanding yet that I need to learn.

Hey. If you just need to center them both, you don’t need the offset. Just give your column full width (col-12) and add a text-center class. That should be enough!

Thanks @noyb . Is using offsets something I should avoid? Or is this a much simpler solution to this scenario?

There’s nothing wrong about using them but if you want to center stuff they won’t help that much and, yes, “text-center” is a much simpler solution indeed!

1 Like