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>

 

 

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

相关文章:

  • 2022-03-07
  • 2021-08-05
  • 2022-02-17
  • 2021-11-30
  • 2021-12-09
  • 2021-11-21
  • 2022-01-23
猜你喜欢
  • 2021-09-01
  • 2021-10-25
  • 2022-02-20
  • 2022-01-28
  • 2021-12-25
  • 2022-02-06
  • 2021-12-06
相关资源
相似解决方案