carlos-sanchez
11/25/2013 - 1:06 AM

Absolute Center with flexbox. Content can be any width or height, even overflows gracefully No IE8-9 support Requires a container or styles

Absolute Center with flexbox. Content can be any width or height, even overflows gracefully No IE8-9 support Requires a container or styles on the body

.parent{
  display: flex;
}
.child{
  margin: auto;
}
.Center-Container.is-Flexbox {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
     -moz-box-align: center;
     -ms-flex-align: center;
  -webkit-align-items: center;
          align-items: center;
  -webkit-box-pack: center;
     -moz-box-pack: center;
     -ms-flex-pack: center;
  -webkit-justify-content: center;
          justify-content: center;
}