六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 119|回复: 0

css hacks

[复制链接]

升级  82%

9

主题

9

主题

9

主题

童生

Rank: 1

积分
41
 楼主| 发表于 2013-2-7 20:41:49 | 显示全部楼层 |阅读模式
某些情况下需要让IE和FF显示不一样的CSS属性,方法自然是多种的,可以用JS来控制,也可以进行CSS HACKS。
   CSS HACKS 有2中方法:
     1.<!--[if gte IE 6]>
<link rel="stylesheet" href="../includes/IEFix.css" type="text/css" />
<![endif]-->这种注释类的方法很好用.
The syntax for conditional comments is as follows:

Positive
<!--[if condition]> HTML <![endif]-->
Negative
<!--[if !condition]><![IGNORE[--><![IGNORE[]]> HTML <!--<![endif]-->
condition is one of the following:

IE
Any version of IE
lt IE version
Versions less than version
lte IE version
Versions less than or equal to version
IE version
Only version version
gte IE version
Versions greater than or equal to version
gt IE version
Versions greater than version
version is the version of Internet Explorer, typically 5, 5.5, 6, or 7

    2.第2种方法是用*来连接需要在IE下显示的CSS
    /* IE Fix */
* .content2 {
display: inline-block;
}这个方法不一定好用,我今天在FF3.5下测试就没通过
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表