Answers for "vertical align text inside div"

CSS
12

css vertical align

.top-align {
	vertical-align: top;
}  

.center-align {
  	vertical-align: middle;
}
Posted by: Guest on February-15-2020
1

align text vertically in div

/* CSS */
div.outer { 
  display: table; 
}

div.inner {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}

/* HTML */
<div class="outer">
  <div class="inner">
    lorem ipsum... 
  </div>
</div>

/* 
------------------------------------
'vertical-align' values: 
	top | middle | bottom 
	text-top | text-bottom 
    super | baseline | sub 
    % | px 
*/
Posted by: Guest on July-02-2021
3

vertical align center text inside div

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

vertical align text inside div

text {
  	line-height: 100px; /*size of parent div*/ 
}
Posted by: Guest on April-29-2020

Code answers related to "vertical align text inside div"

Browse Popular Code Answers by Language