How to center image in a page html?

1
Tiara Turner asked a question: How to center image in a page html?
Asked By: Tiara Turner
Date created: Fri, Oct 29, 2021 9:52 PM
Date updated: Fri, Nov 18, 2022 5:38 AM

Content

Top best answers to the question «How to center image in a page 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