zoukankan      html  css  js  c++  java
  • 今天工作中发现一个问题,看算不算BUG,如何解释这种现象。


    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>bug</title>
    <style>
    ul,li{margin:0;padding:0;list-style:none;}
    .fl{float:left;display:inline;}
    .imgList{200px;background:red;}
    .imgList li{height:20px;border:1px solid green;}
    </style>
    </head>
    <body>
    <ul class="imgList fl">
    <li>IE6 IE7与UL产生的间距</li>
    </ul>
    </body>
    </html>

    注意IE6 IE7下的效果与其它浏览器效果不一致。
    由于项目需求,必须用到float:left;display:inline;问题来了,如果把这个class给如上代码UL,IE6 IE7 LI前就出现莫名间距。换成其它标签不会出现此现象。
    比如换成:dl dd

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>bug</title>
    <style>
    dl,dd{margin:0;padding:0;list-style:none;}
    .fl{float:left;display:inline;}
    .imgList{200px;background:red;}
    .imgList dd{height:20px;border:1px solid green;}
    </style>
    </head>
    <body>
    <dl class="imgList fl">
    <dd>换标签了一切正常了</dd>
    </dl>
    </body>
    </html>

    针对代码ul li现象尝试了如下解决办法:
    1、给li也float:left;
    2、去掉UL的display:inline;

    由于IE6有符动间距BUG所以.fl{float:left;display:inline;}习惯性的写在一起。让我等不得其解的是为何只跟UL LI有关呢?这算是一个BUG么?求点解!所以然!!

    原来是它在捣鬼:list-style-position:outside;呵呵!完必!

  • 相关阅读:
    Docker和K8S
    CoBot 库博源代码缺陷检测工具
    Hobot软件成分分析平台
    Black duck(黑鸭子软件)开源代码审计管理测试平台
    python之理解super及MRO列表
    Python中MRO排序原理
    python中with的用法
    使用微服务架构重构支付网关
    支付网关的设计原则
    python内存管理--垃圾回收
  • 原文地址:https://www.cnblogs.com/radom/p/2152468.html
Copyright © 2011-2022 走看看