Answers for "how to center a div horizontally css"

CSS
9

center div horizontally and vertically

.parent {
  position: relative;
}
.child {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
Posted by: Guest on June-22-2020
0

center a fixed div horizontally

left: 50%;
transform: translateX(-50%);
Posted by: Guest on December-06-2019

Code answers related to "how to center a div horizontally css"

Browse Popular Code Answers by Language