это сработало для меня:
Style.css
div { position: relative; top: 50%; transform: translateY(-50%); }
Я нашел этот фрагмент кода здесь .