ul, li, a如何用(谷歌/火狐/ie6/7/8)中检测

2021-01-20 11:56 jianzhan


拷贝编码
编码以下:

<style type="text/css">
*{margin:0; padding:0;font-size:14px}
body{padding-top:20px}
ul,li{list-style: none}
ul{background: yellow;}
li{float:left;height:50px;}
a{display:inline-block;padding:0 30px;line-height: 50px;background:pink url(images/dian.jpg) no-repeat left center; width:60px;margin-left:30px;white-space:nowrap;overflow: hidden;}
/*外界div未设定高宽比, 清晰其內部div波动造成摆脱文本文档流*/
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: ".";
clear: both;
height: 0;
}
/*由于ie6、7不可以鉴别伪类, 而只必须用zoom:1既能开启合理布局*/
* html .clearfix {zoom: 1;} /*IE6*/
*:first-child+html .clearfix {zoom: 1;} /*IE7*/
</style>
</head>
<body>
<ul class="clearfix">
<li><a href="###">aaaaaaaaaaaaaaaaaaaaaaaa</a></li>
<li><a href="###">b</a></li>
<li><a href="###">ccc中中中</a></li>
</ul>
</body>

下面全部访问器指的是谷歌、火狐、ie6、7、8