Check out example codes for "css align text vertically". It will help you in understanding the concepts better.

Code Example 1

<!DOCTYPE html>
    <title>Title of the document</title>
    <style type="text/css">
      div {
        display: table-cell;
        width: 250px;
        height: 200px;
        vertical-align: middle;
    <div>Vertically aligned text</div>

Code Example 2

/* HTML: */
<div class="text">
lorem ipsum

/* CSS: */
.text {
vertical-align: middle;
/*can take any value of:
baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length> */

Code Example 3

.center {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  border: 3px solid 

Code Example 4

.center {
  padding: 70px 0;
  border: 3px solid 
  text-align: center;


Code Example 5

vertical-align: middle;

Code Example 6{display:block;margin:auto;width:50%;}{text-align:center;}

Learn ReactJs, React Native from