Answers for "vertically align center text in div"

CSS
24

center with css

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

vertical align center text inside div

.center {
  height: 309px;
  line-height: 309px; /* same as height! */
}
Posted by: Guest on January-27-2021

Code answers related to "vertically align center text in div"

Browse Popular Code Answers by Language