Home >
Web Front-end >
HTML Tutorial >
CSS: How to write vertical and horizontal centering of DIV interface_html/css_WEB-ITnose
CSS: How to write vertical and horizontal centering of DIV interface_html/css_WEB-ITnose
WBOY
Release: 2016-06-24 12:32:48
Original
1247 people have browsed it
If you want to keep a DIV centered vertically and horizontally at the same time, you can use the following CSS code to achieve it: {width:612px; height:470px; margin-top:-235px; margin-left:-306px ; position:absolute; top:50%; left:50%;}
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn