css vertical align middle

CSS
/* Answer to: "css vertical align middle" */

/*
  Go to: https://www.w3schools.com/css/css_align.asp
  Here you can learn many ways to align horizontal and vertically!
  My favourite method is below:
*/

.center {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  border: 3px solid green;
}.container{	
	margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
  	width: /* Define the width here; */
    height: /* Define the height here; */
}

/*You have to define the width and height! */    img.a {
  vertical-align: baseline;
}

img.b {
  vertical-align: text-top;
}

img.c {

      
    vertical-align: text-bottom;
}

img.d {
  
    vertical-align: sub;
}

img.e {
  vertical-align: super;
}  .container{
  display: table;
}

.div-inside-container{
  display: table-cell;
  vertical-align: middle;
}<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style type="text/css">
      div {
        display: table-cell;
        width: 250px;
        height: 200px;
        vertical-align: middle;
      }
    </style>
  </head>
  <body>
    <div>Vertically aligned text</div>
  </body>
</html><!-- 
	 Simple CSS CENTER DIV Example
 	 
	 * See Fiddle in link for PoC *
-->

<div class="parent">
  <div class="child">
    <p>
      Eh Up Me Duck!
    </p>
  </div>
</div>

<style>
.parent {
  /* Just for aesthetics: see fiddle */
  border: 1px solid black;
  padding: 2px;
}

.child {
  border: 1px solid red;
  width: 50%;
  
  /* This is where the magic happens */
  margin-left: auto;
  margin-right: auto;
  /**********************************/
}

p {
  /* As you do */
  text-align: center;
}
</style>
Source

Also in CSS: