小div在大div中垂直居中,以及div在页面垂直居中
2016-05-15 23:42
330 查看
<html>
<head>
<title>淘宝 2faner</title>
<style type="text/css">
.big{
width: 800px;
height: 500px;
background: #333;
position:absolute;
left: 50%;
top: 50%;
margin-left:-400px;
margin-top: -250px;
}
.small{
width: 400px;
height: 200px;
position: absolute;
left: 50%;
top: 50%;
margin-left:-200px;
margin-top: -100px;
background: #fff;
}
</style>
</head>
<body>
<div class="big">
<div class="small">
</div>
</div>
</body>
</html>
<head>
<title>淘宝 2faner</title>
<style type="text/css">
.big{
width: 800px;
height: 500px;
background: #333;
position:absolute;
left: 50%;
top: 50%;
margin-left:-400px;
margin-top: -250px;
}
.small{
width: 400px;
height: 200px;
position: absolute;
left: 50%;
top: 50%;
margin-left:-200px;
margin-top: -100px;
background: #fff;
}
</style>
</head>
<body>
<div class="big">
<div class="small">
</div>
</div>
</body>
</html>
相关文章推荐
- 记:MySQL 5.7.3.0 安装 全程截图
- 专题三 第15题
- multithreaddownload
- 关于javascript内存分配
- 第10.11周项目 继承和派生(补充)3
- 页面上现有ProgressBar控件progressBar,请用书写线程以10秒的的时间完成其进度显示工作。
- 安卓开发之java基础笔记7内部类与设计模式
- MySQL5.6源码编译安装(CentOS-6.6+MySQL-5.6)(一)
- Problem A: 假金币
- 请描述下Activity的生命周期。
- Swift的optional
- 高可靠芯片搭配视觉演算法,影像式ADAS满足车规要求
- 数据库知识
- WebView与JavaScript的交互
- 基础教程
- geekband android #5 第十一周分享(Gradle、NDK、安卓依赖性)
- 2016"百度之星" - 资格赛
- 如果后台的Activity由于某原因被系统回收了,如何在被系统回收之前保存当前状态?
- android实现仿QQ界面刷新
- CheckPoint运行原理