手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >IE7.0以下版本列表li中的元素错位一个上一个下的解决方法
IE7.0以下版本列表li中的元素错位一个上一个下的解决方法
摘要:HTML:[${ross.parentName}]${ross.title}[${ross.updateDate}]CSS:.time{fl...

HTML:

<li><span>[${ross.parentName}] </span><a href="../ShowNews?id=${ross.newsID}">${ross.title } </a><span>[${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,

【IE7.0以下版本列表li中的元素错位一个上一个下的解决方法】相关文章:

Google浏览器CSS居中兼容问题完美解决方法

img图片元素下多余空白解决方案

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

IE6下图片下方有空间距的多种解决方法

ie placeholder属性的兼容性问题解决方法

div标签中的元素margin-top失效的解决方法

DIV+CSS页面布局中BUG解决方法

firefox中div+css的外层背景色不见的解决方法

在input中右边加上一个图标的css样式

CSS 控制因Html页面高度导致抖动的问题解决方法

精品推荐
分类导航