Answers for "• To center an element, a width must be set for that element."

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

Code answers related to "• To center an element, a width must be set for that element."

Browse Popular Code Answers by Language