• 【兼容】ul—li子元素浮动—3px—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>无标题文档</title>
    <style type="text/css">
    *{ list-style:none; margin:0; padding:0; font-size:12px;}
    div div{ width:100%; height:24px; overflow:hidden; border-bottom:1px solid #f00; background:#ff0; line-height:24px;}
    a{ float:left; width:30%;}
    
    li{ width:100%; height:24px; overflow:hidden; border-bottom:1px solid #f00; background:#fc0; line-height:24px;}
    
    /*ie6ie7的bug,解决:让li也浮动
    ul{ 100%; overflow:hidden;}
    li{ float:left; 100%; height:24px; border-bottom:1px solid #f00; background:#fc0; line-height:24px;}*/
    </style>
    </head>
    
    <body>
    <div>
        <div><a href="#">111</a><a href="#">111</a></div>
        <div><a href="#">111</a><a href="#">111</a></div>
        <div><a href="#">111</a><a href="#">111</a></div>
        <div><a href="#">111</a><a href="#">111</a></div>
        <div><a href="#">111</a><a href="#">111</a></div>
        <div><a href="#">111</a><a href="#">111</a></div>
    </div>
    <ul>
        <li><a href="#">111</a><a href="#">111</a></li>
        <li><a href="#">111</a><a href="#">111</a></li>
        <li><a href="#">111</a><a href="#">111</a></li>
        <li><a href="#">111</a><a href="#">111</a></li>
        <li><a href="#">111</a><a href="#">111</a></li>
        <li><a href="#">111</a><a href="#">111</a></li>
    </ul>
    </body>
    </html>

    方法2:给li子元素添加vertical-align除baseline的任意值。不打算用这种方法

  • 相关阅读:
    CSP-S 2020 游记
    USACO Mowing the Lawn
    洛谷 P1725 琪露诺
    浅谈单调队列
    浅谈单调栈
    洛谷 P1440 求m区间内的最小值
    POJ 2823 Sliding Window
    洛谷 P1901 发射站
    POJ 2796 Feel Good
    POJ 2559 Largest Rectangle in a Histogram
  • 原文地址:https://www.cnblogs.com/jzm17173/p/2593203.html
Copyright © 2020-2023  润新知