How do i float an image in the center?

1
Bert Dach asked a question: How do i float an image in the center?
Asked By: Bert Dach
Date created: Sat, Jul 10, 2021 5:28 AM
Date updated: Fri, Jun 24, 2022 2:52 PM

Content

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

An <img> element is an inline element (display value of inline-block ). It can be easily centered by adding the text-align: center; CSS property to the parent element that contains it. To center an image using text-align: center; you must place the <img> inside of a block-level element such as a div .

Your Answer