I can’t center the image!

Asked

Viewed 2,731 times

0

How I center a image within a DIV? (html)

  • use the display:flex align-items:center Justify-content:center (for the image to not leak from inside the element, you can also place an overflow:Hidden)

1 answer

0


  • 2

    Etiquette <center> is advised against/not supported in Html5. Reference

  • Obs. for auto margin to work the element has to be display block with defined width

Browser other questions tagged

You are not signed in. Login or sign up in order to post.