F-y-o-d-o-r
12/12/2017 - 6:58 PM

html - css - center block with transform

html - css - center block with transform

<main>
 <div>Content centered vertically</div>
</main>
main { position: relative; }
main div {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}