Iefans,靠谱的软件下载站

首页 最新文章 最新安卓 最新苹果 浏览器 IE教程 在线图片编辑 最新软件 最新游戏

当前位置: IEfans / IE专区 / IE修复/ IE7.0以下版本列表li中的元素错位一个上一个下的解决方法

IE7.0以下版本列表li中的元素错位一个上一个下的解决方法

编辑:秩名2023-06-14 19:30:02

HTML:

复制代码代码如下:
lispan class="tag"[${ross.parentName}] /spana href="../ShowNews?id=${ross.newsID}"${ross.title } /aspan class="time"[${ross.updateDate}]/span/li

CSS:

复制代码代码如下:
.time{float:right}

以上代码会在IE7.0以下time元素与a元素错位,一个在上,一个在下。导致的原因是这种情况下span-time元素的margin-top会自动增加20px左右(具体为什么增加不知道,如果哪位大神知道的话给我留个言哈~感激不尽)。解决方法如下,运用CSS hack :

复制代码代码如下:
.time{float:right;*margin-top:-20px;}

CSS hack 知识:

复制代码代码如下:
区别IE6与FF:
background:orange;*background:blue;
区别IE6与IE7:
background:green !important;background:blue;
区别IE7与FF:
background:orange; *background:green;
区别FF,IE7,IE6:
background:orange;*background:green;_background:blue;
background:orange;*background:green !important;*background:blue;

注:IE都能识别*;标准浏览器(如FF)不能识别*;
IE6能识别*,某些情况下不能识别 !important,
返回旧版Copyright © 1998-2023 www.iefans.net All Rights Reserved 沪ICP备17019769号-18 意见反馈