【技术】居中(不适用于IE7及以下版本)
2015-08-28 16:15
337 查看
html部分:
<div class="p-r">
<div class="a-c-a"></div>
</div>
css部分:
.pr{
position: relative;
}
.a-c-a{
position: absolute;
width: 200px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
height: 400px;
top: 0;
bottom: 0;
margin-top: auto;
margin-bottom: auto;
border: 1px solid red;
}
简写:
.pr{
position: relative;
}
.a-c-a{
position: absolute;
width: 200px;
height: 400px;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
border: 1px solid red;
}
相关文章推荐
- 经典算法之0-1背包问题
- 很让人受教的 提高php代码质量36计
- Win10预览版10532怎么样?Win10预览版10532上手演示视频
- 文件下载兼容各种浏览器
- exfat文件系统(七)------exfat_core.c详解(一)------CLUSTER HEAP(BMAP_DENTRY_T以及相关)
- windows下使用vfw方式生成AVI视频的实现
- windowsAPI之OpenProcessToken,AdjustTokenPrivileges 和LookupPrivilegeValue
- zzuli OJ 1044: 不及格率
- HDU 2766
- android SDK 无法更新的问题
- Android TouchEvent之requestDisallowInterceptTouchEvent
- ios开发之 Xib设置圆角
- QML基础——在C++程序中使用QML
- 放言五首·其三
- Struts 2 Overview
- //判断用户代理
- JavaScript中的this关键字
- windows 2008R2 ii7 安装后访问出现500错误!!!
- update 用法
- POJ3494--Largest Submatrix of All 1's(二维栈)