How to center elements

omoemo pro asked 9 years ago

Hi, I am trying to simply center elements on a row and on the screen. I am having trouble with both. Everything I find talks about aligning text, but nothing seems to be working for elements like cards and buttons. Do elements have to be wrapped in a container/row/column in order for them to be centered? So, two questions: 1. How to center elements on their row? 2. How to center elements vertically and horizontally on the screen? By the way, I am using react components with MDB if that makes any difference.

rhrjujth commented 6 years ago

办加拿大毕业文凭,Q\微信374936141,办理加拿大达尔豪斯大学毕业证成绩单办达尔豪斯大学文凭毕业证修改成绩单文凭公证/办留学回国人员证明【原版1比1制作文凭】|Dalhousie University

nettemple pro answered 6 years ago

<div class="d-flex justify-content-center">

nettemple pro commented 6 years ago

BTW - Now that the link works - excellent answer.

Michal Szymanski staff pro premium priority answered 9 years ago

Hi,

have you read our documentation for flexbox ?

It should be helpful.

And react doesn't make any difference, as far as it doesn't use any CSS code which overwrite CSS code of MDB


nettemple pro commented 7 years ago

Useless answer

Reza Assar commented 6 years ago

@Michal Szymanski link is broken!

Michal Szymanski staff pro premium priority commented 6 years ago

Try it now

Marta Szymanska staff pro premium answered 6 years ago

Hi, thanks for the solution. Best, Marta
Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No