Answers for "horizontal content center"

CSS
39

center with css

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

center div content

**HTML**
<div class="container">
  <div class="child"></div>
</div>

**CSS**
.container {
  position: relative;
}

.child {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
Posted by: Guest on March-02-2022

Code answers related to "horizontal content center"

Browse Popular Code Answers by Language