Bootstrap: Problems when using justify-content-center does not work when using with display utilities (d- {sm, md, lg, xl})

Created on 1 Oct 2017  路  3Comments  路  Source: twbs/bootstrap

I am having a problem with using display utilities (d- {sm, md, lg, xl}) in a row that has justify -content-center to row to center the column in the center plus someone had this problem or any solution to this?

Here is an example of the problem code

<div class="row  justify-content-center d-none d-sm-block">
  <div class="col-10">
    <div class="row  text-center">
      <div class="col-12 col-sm" style="background-color: #000000;">
        <p>Text Exemple</p>
      </div>
    </div>
  </div>
</div>

Greetings

css v4

Most helpful comment

@import "../node_modules/bootstrap/scss/utilities";

All 3 comments

Use of flex utilities requires a display: flex. Change your d-sm-block to d-sm-flex.

@import "../node_modules/bootstrap/scss/utilities";

Using d-sm-flex did solve my justify-content-center issue. But I want to understand why this simple change worked.

Can someone please explain?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devfrey picture devfrey  路  3Comments

tiendq picture tiendq  路  3Comments

iklementiev picture iklementiev  路  3Comments

devdelimited picture devdelimited  路  3Comments

IamManchanda picture IamManchanda  路  3Comments