首页 > 其他 > 详细

整个页面所有元素垂直居中

时间:2017-08-07 13:15:55      阅读:188      评论:0      收藏:0      [点我收藏+]
 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 2 <html>
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 5 <title>无标题文档</title>
 6     <style type="text/css">
 7         html,body
 8         {
 9             height:100%;
10             margin:0;
11         }
12         body
13         {
14             -webkit-align-items:center;
15             -ms-flex-align:center;
16             align-items:center;
17             display:-webkit-flex;
18             display:flex;
19         }
20     </style>
21 </head>
22 
23 <body>
24     <div style="height:500px; width:400px; background-color:#095;margin-left:auto;margin-right:auto;">
25         aSDadasdASD
26         <BR/><BR/><BR/><BR/><BR/><BR/>
27         342532523543
28         <BR/><BR/><BR/><BR/><BR/><BR/>
29     </div>
30 </body>
31 </html>

 

 

技术分享

整个页面所有元素垂直居中

原文:http://www.cnblogs.com/huashanqingzhu/p/7298426.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!