I am trying to centre image that sits in a footer widget. I’ve read several of the solutions provided here but I am not sure if I am setting up the code right
MY CSS
#footer img.center {
display: block;
margin-left: auto;
margin-right: auto;
}
MY HTML
<img class="display" src="....">
You have to add the class ‘center’ on your html code :
Everything else is fine. and margin ‘auto’ properties is not working without width. so maybe you can add width of image on your css code.
In image class name is
display
. So change you class name in css.Demo
In your css you defined that the class is center (and not display), so in your HTML: