zoukankan      html  css  js  c++  java
  • IE6下与float元素相邻的position:absolute元素消失BUG

    代码
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>IE6下与float元素相邻的position:absolute元素消失BUG</title>
    <style type="text/css">
    *
    { margin:0; padding:0}
    .wrap
    { width:800px; height:200px; margin:0 auto; position:relative}
    .left
    { width:300px; height:200px; background-color:#F00; float:left}
    .right
    { width:500px; height:200px; background-color:#00F; float:left}
    .pos
    { width:600px; height:30px; background-color:#000; color:#fff; position:absolute; left:0; top:0;}
    .pos2
    { top:60px;}
    </style>
    </head>

    <body>
    <div class="wrap">
    <div class="pos">如果不加下面的div,在IE6下是看不见我的</div>
    <!--[if IE 6]><div></div><![endif]-->
    <div class="left"></div>
    <div class="right"></div>
    <!--[if IE 6]><div></div><![endif]-->
    <div class="pos pos2">如果不加上面的div,在IE6下是看不见我的,总之是要与浮动之间加个空的DIV</div>
    </div>
    </body>
    </html>

  • 相关阅读:
    Unity中获取移动设备GPS信息
    Unity打包APP控制顶部状态栏
    Hololens概览
    webdriver中的定位模拟及实例
    selenium等待机制
    seleniumChrom无头浏览器
    selenium规避网站监测
    百度api识别验证码登录
    Pyecharts-数据可视化模块
    Selenium-浏览器兼容性测试自动化
  • 原文地址:https://www.cnblogs.com/bennman/p/1945699.html
Copyright © 2011-2022 走看看