IE6下绝对定位元素和浮动元素并列绝对定位元素消失
2024-10-14 14:48:17
<!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>
最新文章
- Web服务
- Nginx支持比Apache高并发的原因
- qq客服代码
- Xcode8支持iphone4s真机调试
- bzoj1036 [ZJOI2008]树的统计Count
- 苹果应用 Windows 申请 普通证书 和Push 证书 Hbuilder 个推
- A trip through the Graphics Pipeline 2011_13 Compute Shaders, UAV, atomic, structured buffer
- 对CSS进行wxss思路学习,display属性。
- mina
- 收集的URL
- 华为软件开发云对比Jenkins-JavaWeb项目持续部署方式
- cpp - 输入输出
- JAVA日志的前世今生
- ZooKeeper 单机版安装和配置
- laravel的路由分组,中间件,命名空间,子域名,路由前缀
- 编译https://github.com/CIR-KIT/steer_drive_ros时出现的问题
- Zookeeper入门(三)之工作流
- [原]unity3d ios平台内存优化(一)
- drupal7 判断用户是否具有某个权限
- Flash的不同位宽与CPU地址线的接线问题?
热门文章
- ESFramework 4.0 快速上手(06) -- Rapid引擎(续)
- [ An Ac a Day ^_^ ] CodeForces 677B Vanya and Food Processor 模拟
- 在 iOS 应用中直接跳转到 AppStore 的方法
- alertview 添加图片
- insertAdjacentHTML方法详解
- 自定义silverlight中datagrid的排序事件
- log4j配置详解[http://www.iteye.com/topic/378077]
- LeetCode OJ 292.Nim Gam19. Remove Nth Node From End of List
- DefaultHttpClient is deprecated 【Api 弃用]】
- apache: 503