实现效果

不论窗口尺寸,都可以垂直和水平居中。

代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>居中效果</title>
<link href="style.css" rel="stylesheet">
<style type="text/css">
.warp {
width:0;
height:0;
position:fixed;
left:50%;
right:50%;
top:50%;
bottom:50%;
} .loginPanel {
width:500px;
height:400px;
margin-left:-250px;
margin-top:-200px;
background-color:#499ECA;
} </style>
</head>
<body>
<div class="warp">
<div class="loginPanel"> </div>
</div>
</body>
</html>

最新文章

  1. C#中5步完成word文档打印的方法
  2. 【踩坑速记】开源日历控件,顺便全面解析开源库打包发布到Bintray/Jcenter全过程(新),让开源更简单~
  3. pythonchallenge 解谜 Level 1
  4. python中try except执行顺序
  5. webpack-vue搭建,部署到后端
  6. 11. 星际争霸之php设计模式--备忘模式
  7. 2016 - 1- 22 NSURLConnetction --- POST请求
  8. 用来用去还是觉得SDCMS好用
  9. javaweb学习总结五(内省、beanUtils工具包)
  10. timed out waiting for input: auto-logout
  11. DEVC++生成DLL的方法
  12. Microsoft Deployment Toolkit 2013 Preview Release Now Available
  13. Codeforces 437E The Child and Polygon(间隔DP)
  14. oracle 索引 。其中全文检索最变态
  15. iPhone safari中Document事件不触发的解决方案 [冒泡]
  16. 链表回文判断(C++)
  17. 使用Swiper轮播插件引起的探索
  18. keil5一点project就闪退
  19. 各种容器与服务器的区别与联系:Servlet容器、WEB容器、Java EE容器、应用服务器、WEB服务器、Java EE服务器
  20. 项目总结19:layui实现表格渲染、表格搜索、数据获取

热门文章

  1. springboot2.0集成webSocket
  2. Swift调用微信支付宝SDK(Swift4.0)
  3. 一步步创建第一个Vue项目
  4. PyCharm 创建指定版本的 Django (超详细图解)
  5. python常有模块:模块、引入语法、两种执行方式、模块搜索顺序
  6. 基础数据 补充 set() 集合 深浅拷贝
  7. imx6ull增加qt5 qtserialbus库
  8. CF #546 D.E
  9. nodejs研发环境
  10. Python assert statement