IE6下绝对定位元素和浮动元素并列绝对定位元素消失
2016-03-02 19:21
495 查看
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> .box{ width: 200px; height: 200px; border: 1px solid black; position: relative; } .item{ width: 150px; height: 150px; background-color: red; float: left; margin-left: 50px;<!--浮动元素有一个margin需要加上display:inline否则在ie6会出现双边距--> *display: inline; } .box span{ width: 50px; height: 50px; background-color: yellow; position: absolute; right: -10px; top:-10px; } </style> <!-- 解决方案: 在IE6的情况下......浮动元素和绝对定位元素是同级的话定位元素就会消失。所以咱们只要让他们俩不处于同级就可以避免这个bug。譬如37行代码 --> </head> <body> <div class="box"> <div class="item"></div> <p> <span></span> </p> </div> </body> </html>
相关文章推荐
- Servlet中doGet()方法得到的中文是乱码解决办法
- SSH原理与运用(二):远程操作与端口转发
- GoldenGate常见异常处理
- 51nod1630 B君的竞技场
- ARC下OC对象和CF对象之间的桥接(bridge)
- 和python库有关的网址
- iOS之九宫格设计和数据模型转换
- 如何旋转至面向某个物体
- 异常
- 奕新集团--单实例到RAC节点 GG同步
- CF Round 8VC (B. Island Puzzle)判断两个环相等
- Valid Anagram--JavaScript
- 宝宝去了幼儿园不爱说话怎么办?
- hibernate笔记--组合主键映射方法
- 多看看他们
- FTP 实践
- shell学习
- Centos7源码安装mysql
- Qt之QHeaderView自定义排序(QSortFilterProxyModel)
- Android之进程与线程的讲解