I have a div inside another div.
I want to make the inside one in the middle vertically.
I can use this way to achieve it:
calc(50% - 100px ) /* if the height of the inside box is 100px */
However, sometimes the inside box has a variable height, so I want to use something like this:
calc(50% - height )
calc(50% - attr(height) )
calc(50% - this(height) )
I tried many ways but can't succeed. Just like the picture below. It should be placed in the middle between the two thick srokes.
May I know how I can just retrieve the height value inside calc()
function?
Update: I tried this according to jsotola's comment. But it says the property value is invalid.
Thanks