I have div-1
which contains div-2
and a heading inside. The size of div-2
varies. I want the HEADING to be correctly between the top of the two divs as shown in the picture, with different sizes of div-2
. Would love to have it in pure css or scss. I have centered the div2
in div1
using
top: 50%;
left: 50%
transform = translate (-50%, -50%)
but i can't center the 'heading' between the two 'divs'
I do not know the size of div-2
. It keeps varying and I want the heading to be in the middle, unlike in the this where the size of the elements is known.