Answers for "how to align a elemten with position relative in the middle of the page"

CSS
7

center div in middle of page

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  /* bring your own prefixes */
  transform: translate(-50%, -50%);
}
Posted by: Guest on March-01-2020
7

center image with position absolute

.wrapper img {
  left: 50%;
  transform: translate(-50%,0);
  position: absolute;
  z-index: 1 
}
Posted by: Guest on July-24-2020

Code answers related to "how to align a elemten with position relative in the middle of the page"

Browse Popular Code Answers by Language