Image by default is displayed as inline-block, you need to display it as block in order to center it with .mx-auto
. This can be done with built-in .d-block
:
<div class="container"> <div class="row"> <div class="col-4"> <img class="mx-auto d-block" src="..."> </div> </div> </div>
Or leave it as inline-block and wrapped it in a div with .text-center
:
<div class="container"> <div class="row"> <div class="col-4"> <div class="text-center"> <img src="..."> </div> </div> </div> </div>
I made a fiddle showing both ways. They are documented here as well.
Related Posts:
- Bootstrap 4 datapicker.js not included
- Center the content inside a column in Bootstrap
- What is the difference among col-lg-*, col-md-* and col-sm-* in Bootstrap?
- Left align and right align within div in Bootstrap
- Vertical Align Center in Bootstrap
- Bootstrap 4 images thumbnail classes
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- bootstrap-datetimepicker for bootstrap 4
- Bootstrap 4 Carousel sliders not working
- Bootstrap 4, How do I center-align a button?
- Align nav-items to right side in bootstrap-4
- bootstrap 4 row height
- Bootstrap modal not displaying
- Bootstrap align navbar items to the right
- How can I get my Twitter Bootstrap buttons to right align?
- How to fix the error; ‘Error: Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)’
- Can I change Bootstrap button color?
- Customize Bootstrap checkboxes
- What is bootstrapping?
- Failed to load resource: net::ERR_CONNECTION_REFUSED : Nodejs
- Does bootstrap have builtin padding and margin classes?
- Bootstrap Dropdown menu is not working
- What is sr-only in Bootstrap 3?
- How to set up fixed width for
? - How to change btn color in Bootstrap
- How to remove error about glyphicons-halflings-regular.woff2 not found
- How does the data-toggle attribute work? (What’s its API?)
- How to add hamburger menu in bootstrap
- Bootstrap 4 Sticky Footer Not Sticking
- Adding images to a Bootstrap Carousel with AJAX
- How to include bootstrap css and js in reactjs app?
- What does an “&” before a pseudo element in CSS mean?
- Bootstrap NavBar with left, center or right aligned items
- ChangeDate – Date Picker Bootstrap
- How to set up fixed width for
? - Understanding how data-dismiss attribute works in Bootstrap
- Bootstrap dropdown not working
- css to make bootstrap navbar transparent
- What is a “meta component” in the context of bootstrap or as a general web design term?
- Responsive Bootstrap Jumbotron Background Image
- Does bootstrap 4 have a built in horizontal divider?
- bootstrap navbar not working correctly
- Changing the width of Bootstrap popover
- Changing the width of Bootstrap popover
- Bootstrap 4 Dropdown Menu not working?
- TypeError: $(…).modal is not a function with bootstrap Modal
- Mark error in form using Bootstrap
- How to center vertically and horizontally a div using Bootstrap?
- bootstrap 3 navbar collapse button not working
- How to center content in a Bootstrap column?
- How to center image in carousel
- Bootstrap transparent navbar
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery
- How to give spacing between buttons using bootstrap
- Bootstrap carousel not sliding
- how to center form using bootstrap 4
- How can I override Bootstrap CSS styles?
- Can Twitter Bootstrap alerts fade in as well as out?
- Responsive background image in bootstrap container
- Onclick on bootstrap button
- Flushing footer to bottom of the page, twitter bootstrap
- How to change the background-color of jumbrotron?
- Bootstrap 3 Glyphicons are not working
- Placeholder Color Change in Bootstrap
- vertical divider between two columns in bootstrap
- What are these attributes: `aria-labelledby` and `aria-hidden`
- vertical-align with Bootstrap 3
- Bootstrap popover is not working
- Bootstrap change carousel height
- Twitter Bootstrap – add top space between rows
- How to use bootstrap 4 in angular 2?
- Table fixed header and scrollable body
- What is the difference between Bootstrap .container and .container-fluid classes?
- twitter bootstrap autocomplete dropdown / combobox with Knockoutjs
- how to do a line break in Bootstrap 3.3.7
- Bootstrap collapse isn’t working; hamburger menu not showing up
- How can I make Bootstrap columns all the same height?
- How to increase height of textarea using bootstrap rows and columns
- Bootstrap Columns Not Working
- Set bootstrap modal body height by percentage
- Bootstrap 3 Glyphicons CDN
- Bootstrap tooltips not working
- Sass::SyntaxError: File to import not found or unreadable: bootstrap-sprockets
- Bootstrap – floating navbar button right
- Bootstrap combining rows (rowspan)
- How can I change the Bootstrap default font family using font from Google?
- Bootstrap modal – close modal when “call to action” button is clicked
- How do I horizontally center a table in Bootstrap
- Why is my Bootstrap code not working?
- img-responsive in Bootstrap does not work
- Set textarea width to 100% in bootstrap modal
- Creating Accordion Table with Bootstrap
- How to open a Bootstrap modal window using jQuery?
- AngularJS Modal Popup
- In a bootstrap responsive page how to center a div
- Responsive Canvas in Bootstrap column?
- Using glyphicon-facebook from bootstrap 3
- Closing Bootstrap modal onclick
- How to make Bootstrap Panel body with fixed height