Answers for "how to center text horizontally and vertically in css"

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
0

align vertical center text div

display: flex;
align-items: center
Posted by: Guest on May-07-2021
1

how to make the text vertically centered in css

/*attention, i used this code because i had to center a div with text in another div without text*/
div{
  position: relative;
  top: 25%;
  bottom: 25%;
}
Posted by: Guest on January-20-2021
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 "how to center text horizontally and vertically in css"

Browse Popular Code Answers by Language