Rudchyk
2/8/2017 - 9:11 AM

Position center by height

Position center by height

.parent {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.parent {
  height: 100vh;
  max-height: 100%;
  
  &:after {
      content: '';
      display: inline-block;
      height: 100%;
      vertical-align: middle;
  }
  
  .element {
    display: inline-block;
    vertical-align: middle;
  }
}
.parent {
  position: relative;
  
  .element {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}