css position:absolute 水平垂直居中对齐

WBOY
Release: 2016-06-01 09:53:31
Original
3350 people have browsed it

此实例将div元素相对屏幕居中,css代码如下:

<code>.class{
    position: absolute;
    left: 50%;
    width: 980px;
    margin-left: -490px;
    text-algin:center
}</code>
Copy after login

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