0

I have a container which has 2 divs. I'm looking to vertically centre the first div and the second div to sit beneath it following the natural flow. See attached image. container

I'm currently centring it by adding padding top to the first div through "container height - the first div height / 2" Is there another way I can achieve this?

Billy Brown
  • 209
  • 1
  • 5
  • 14
  • related:https://stackoverflow.com/a/55393886/8620333 <-- you change the direction from row to column and you remove the first child – Temani Afif Jul 18 '21 at 14:34
  • Anycode to share? Is this a single container with 2 children ? Is there a fixed height, are you using some kind of display alike grid,flex,table, else ? – G-Cyrillus Jul 18 '21 at 14:38
  • ... while waiting for feed back, here is a grid possibility: https://codepen.io/gc-nomade/pen/jOmwWJN have fun – G-Cyrillus Jul 18 '21 at 14:51

0 Answers0