position:absolute;的DIV 如何居中
2016-06-17 12:13
323 查看
外层DIV{position:realtive}
内层DIV{positon:absolute;top:50%;left:50%;margin-top:-100px;margin-left:-150px;width:300px;height:200px;}
内层DIV{positon:absolute;top:50%;left:50%;margin-top:-100px;margin-left:-150px;width:300px;height:200px;}
<div class="father"> <div class="son"> </div> </div>
.father{ position:realtive; width:100%; height:100%; } .son{ position: absolute; left: 50%; top: 50%; z-index: 1; width: 1200px; margin-left: -600px; height:600px; margin-top:-300px; }
相关文章推荐
- 算法与数据结构描述
- 使用VB6资源文件开发多国语言应用攻略
- [置顶] 融云后台服务创建token
- PS制作中国古代风格的封面
- 第三方包属性的定义(这里是以刷新库为例)
- spring mvc数据绑定
- 多进程单线程模型与单进程多线程模型之争
- Ionic Js十一:模态
- 明天软软onsite
- Eclipse中通过Tomcat运行J2EE项目java.lang.OutOfMemoryError: PermGen space的解决方案
- 学院引我走向新世界
- JAVA JDK1.5-1.9新特性
- [黑金原创教程] FPGA那些事儿《设计篇 II》- 图像处理前夕·续
- U3D前后端开发知识体系
- Android studio一些快捷键的使用介绍
- Android开发之JSON数据的格式问题
- 未通过ovf规范一致性或虚拟硬件合规性检查
- spring注解 总结
- php array
- Git与SourceTree使用详细指南