Css implements code for the vertical and horizontal center effect of the browser, and css Center
Code for implementing the vertical and horizontal center effect of the browser using css:
It may be because the center is relatively more beautiful, so some pop-up windows or functional modules appear in the middle of the webpage. The following describes how one end uses css to vertically and horizontally center the div, the Code is as follows:
<! DOCTYPE html>
The above code implements div vertical and horizontal center effect. The following briefly introduces the principle.
Implementation principle:
First, set div to absolute positioning, and then set its top and left values to 50% respectively, but this does not achieve the vertical and horizontal center effect of the div center, the vertical and horizontal center is implemented in the upper left corner of the div, so we have to use the margin to set the upper margin and the left margin to negative numbers, and the size is half of the height and width, respectively, in this way, the center point is centered.
The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 15400.
For more information, see: http://www.softwhy.com/divcss/