Important! The vertical center relative to the height of the parent
If the parent of the element you are trying to center does not have a specific height , none of the vertical centering solutions will work!
Now for vertical centering in Bootstrap 4 ...
You can use the new flexbox & size utilities to make container full height and display: flex . These parameters do not require additional CSS (except that the height of the container (i.e.Html, body) should be 100% ).
Option 1 align-self-center on child flexbox
<div class="container d-flex h-100"> <div class="row justify-content-center align-self-center"> I'm vertically centered </div> </div>
https://www.codeply.com/go/fFqaDe5Oey
Option 2 align-items-center on parent .row flexbox ( .row is display:flex; flex-direction:row )
<div class="container h-100"> <div class="row align-items-center h-100"> <div class="col-6 mx-auto"> <div class="jumbotron"> I'm vertically centered </div> </div> </div> </div>

https://www.codeply.com/go/BumdFnmLuk
Option 3 justify-content-center for parent .card flexbox ( .card is display:flex;flex-direction:column )
<div class="container h-100"> <div class="row align-items-center h-100"> <div class="col-6 mx-auto"> <div class="card h-100 border-primary justify-content-center"> <div> ...card content... </div> </div> </div> </div> </div>
https://www.codeply.com/go/3gySSEe7nd
Learn more about Bootstrap 4 Vertical Centering
Now that Bootstrap 4 offers flexbox and other utilities , there are many approaches to vertical alignment. http://www.codeply.com/go/WG15ZWC4lf
1 - vertical center using auto fields:
Another way to center vertically is to use my-auto . This will center the element inside the container. For example, h-100 col-sm-12 is the row height, and my-auto will be vertically col-sm-12 .
<div class="row h-100"> <div class="col-sm-12 my-auto"> <div class="card card-block w-25">Card</div> </div> </div>
Vertical Center Using Auto Margins Demo
my-auto represents fields on the vertical Y axis and is equivalent to:
margin-top: auto; margin-bottom: auto;
2 - Vertical Center with Flexbox:

Since Bootstrap 4 .row now display:flex you can just use align-self-center in any column to vertically align-self-center it ...
<div class="row"> <div class="col-6 align-self-center"> <div class="card card-block"> Center </div> </div> <div class="col-6"> <div class="card card-inverse card-danger"> Taller </div> </div> </div>
or use align-items-center on everything .row to center vertically all col-* in a row ...
<div class="row align-items-center"> <div class="col-6"> <div class="card card-block"> Center </div> </div> <div class="col-6"> <div class="card card-inverse card-danger"> Taller </div> </div> </div>
Vertical center Different column heights Demonstration
Look at this Q / A in the center, but keep the same height
3 - Vertical center using display utilities:
Bootstrap 4 has display utilities that can be used for display:table , display:table-cell , display:inline , etc. They can be used with vertical alignment utilities to align elements of inline, inline blocks, or table cells.
<div class="row h-50"> <div class="col-sm-12 h-100 d-table"> <div class="card card-block d-table-cell align-middle"> I am centered vertically </div> </div> </div>
Vertical Center Using the Utils Demo Display
More examples
The vertical center image in the <div>
Vertical Center .row in.container
Vertical center and bottom in the <div>
The vertical center of the child inside the parent
Vertical center full screen jumbotron
Important! Did I mention height?
Remember that vertical centering is relative to the height of the parent element. If you want to focus on the whole page, in most cases it should be your CSS ...
body,html { height: 100%; }
Or use min-height: 100vh ( min-vh-100 in Bootstrap 4.1+) on the parent / container. If you want to center the child inside the parent. The parent must have a certain height .
Also see:
Vertical alignment at boot 4
Bootstrap 4 centered vertically and horizontally