from http://stackoverflow.com/a/34914335
Basically, you just need a two containers and make sure your elements meet the following criteria.
- should have display: table;
- should have display: table-cell;
- should have vertical-align: middle;
- should have text-align: center;