Answers for "align image to center of a div"

7

centre align image in div

body {
  margin: 0;
}

#over img {
  margin-left: auto;
  margin-right: auto;
  display: block;
}
Posted by: Guest on November-06-2020
4

image center in div

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 40%;
}
Posted by: Guest on December-28-2020
6

centering css elements

// add to the parent element
.parent {
	display: grid;
    place-items: center;
}
Posted by: Guest on August-06-2020

Code answers related to "align image to center of a div"

Browse Popular Code Answers by Language