Home > Web Front-end > HTML Tutorial > DIV centered CSS_html/css_WEB-ITnose

DIV centered CSS_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:30:50
Original
1177 people have browsed it

When you are new to CSS, you often encounter the situation of positioning DIV. This CSS can make the DIV automatically centered:

position: absolute; width:420px; height:230px; left :50%; top:50%;margin-left:-250px; margin-top:-100px; border: 1px solid #ccc;

Collect so you won’t forget

position: absolute; yes Absolute positioning

position:relative; is the superior element relative to the current element

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template