Align vertically and horizontally

67

.parent {
  position: relative;
}
.child {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.parent-div .child-div {
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
}

Comments

Submit
0 Comments