How do i center align an image in html?

1
Sallie Herman asked a question: How do i center align an image in html?
Asked By: Sallie Herman
Date created: Sun, Aug 1, 2021 2:38 AM
Date updated: Wed, Sep 28, 2022 10:43 PM

Content

Top best answers to the question «How do i center align an image in html»

To center an image using text-align: center; you must place the <img> inside of a block-level element such as a div . Since the text-align property only applies to block-level elements, you place text-align: center; on the wrapping block-level element to achieve a horizontally centered <img> .

Your Answer