Results 1 to 1 of 1

Thread: learning - cant figure center img

  1. #1
    Junior Member
    Join Date
    Feb 2018

    learning - cant figure center img

    Hey all
    I am new to bootstrap and and figure this out. I created a bootstrap website following a guide. I am trying to center an image on small screens. I have a row with 2 columns both taking up half the row col-md-6. When it gets to small screens the image is to close to the left.


    <div class="row">
          <div class="col-md-6">
           <img src="../img/explore.jpeg" class="img-fluid mb-3" style="max-width: 80%; border-radius:5px;" />
    I have tried adding the following classes to the img
    class="d-flex flex-row justify-content-center"
    class="d-flex flex-row justify-content-around"

    also tried text-align-center on the div holding the image.

    I know i can use CSS margin: 0 auto; but isnt there an easier way. mx-auto didnt work.


    read the documentation so its mx-auto but how do i make it only for small screens.

    can i do something like d-md-inline? that would remove the mx-auto right
    Last edited by bronxsystem; 02-17-2018 at 07:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts