CSS
Centering in CSS

Centering in CSS

Grid

.content-center {
  display: grid;
  place-content: center;
}

Flex

.gentle-flex {
  display: flex;
  justify-content: center;
  align-items: center;
}
.autobot {
  display: flex;
}
 
.autobot > * {
  margin: auto;
}

Position

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

References