How to Center an Image Vertically and Horizontally with CSS

PHOTO EMBED

Mon Feb 07 2022 08:21:55 GMT+0000 (UTC)

Saved by @aabhishek22 #css

img {
  width: 80%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
content_copyCOPY

https://www.freecodecamp.org/news/how-to-center-an-image-in-css/