There is such a code

<div class="col-lg-6 col-xs-12" style="text-align: center;"> <img src="/images/usual_people.png"/> <br /><br /> <div style="border:2px solid #c5c6c6; padding:10px; border-radius:20px; width:200px;"> duddeniska </div> </div> 

Why is the block with the inscription not centered?

enter image description here

  • 3
    Give it a margin: 0px auto; if you want to leave the block, or inline-block - user190134
  • Sometimes, it is not bad enough to save <div align="center"> </div> - Dan the Hat

1 answer 1

  1. margin: 0 auto; for div

  2. To align the contents of the center in the bootstrap there is a class that allows you not to write style="text-align:center;" - text-center

     <div class="col-lg-6 col-xs-12 text-center"> <img src="/images/usual_people.png"/> <br /><br /> <div style=" border:2px solid #c5c6c6; padding:10px; border-radius:20px; width:200px; margin: 0 auto; "> duddeniska </div> </div>