Home > Web Front-end > HTML Tutorial > css to realize that the pop-up window is always centered vertically and horizontally_html/css_WEB-ITnose

css to realize that the pop-up window is always centered vertically and horizontally_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:39:01
Original
1153 people have browsed it

< html >

< head >

< meta charset = " utf-8" >

< meta name = "author" content = " http://www.softwhy.com/" />

< title >蚂蚁部落

< style type = "text/css" >

body{

   height:1000px;

}

.antzoen{

   position:fixed;

   width:250px;

   height:100px;

   background:#ececec;

   left:50%;

   top:50%;

   margin-left:-125px;

   margin-top:-50px

}

< body >

< div class = "antzoen" >



但是这种方法ie6不支持fixed属性,但是现在大多不再考虑ie6。所以尽可以放心使用。

版权声明:本文为博主原创文章,未经博主允许不得转载。

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