[Updated April 2022]: Tested and included version 5.1 of Bootstrap.
I know this question is quite old. And the question didn't mention which version of Bootstrap he was using. So I assume the answer to this question is already solved.
If any of you (like me) stumble upon this question and are looking for an answer using the current bootstrap 5.0 (2020) and 4.5 (2019) framework, here is the solution.
Bootstrap 4.5, 5.0 and 5.1
Use d-flex justify-content-center on the column div. This will center everything in that column.
[Updated April 2022]: Tested and included version
5.1
of Bootstrap.I know this question is quite old. And the question didn't mention which version of Bootstrap he was using. So I assume the answer to this question is already solved.
If any of you (like me) stumble upon this question and are looking for an answer using the current bootstrap 5.0 (2020) and 4.5 (2019) framework, here is the solution.
Bootstrap 4.5, 5.0 and 5.1
Use
d-flex justify-content-center
on the column div. This will center everything in that column.If you want to align text within a column, just use
text-center
If you have text and images in the column, you need to use
d-flex
justify-content-center
andtext-center
.use:
instead of
You can also use bootstrap 3 css:
Bootstrap 4 now has a Flex class for centering content:
Please note that by default it will be
x-axis
unlessflex-direction
iscolumn