Get the App
SLTechnology News&Howtos  ›  Development  › 

How to center div vertically based on known height and width

Shulou Source: shulou.com Published: 2022-06-03 14:01:37 10月03日 Update

This article will explain in detail how to absolutely vertically center div according to the known height and width. The content of the article is of high quality. Therefore, Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.

The code is as follows:

Known wide height DIV vertical horizontal residence Known wide height DIV vertical horizontal residence Description: width:821px; height:392px

margin is half the height and half the width

About how to share it here according to the known height and width absolute vertical centering div, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Tags: Content article more level knowledge article height good code quality reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Redmi Docker MySQL Apple