CSS中怎么写能让IE8显示出来 火狐不显示出来

html-css010

CSS中怎么写能让IE8显示出来 火狐不显示出来,第1张

尊敬的用户,您好!很高兴为您答疑。

以color属性为例,

color:#ff0000/*一般属性ff*/

color:#ff0000\9/*仅针对ie8有效*/

*color:#ff0000/*仅针对ie7有效*/

_color:#ff0000/*仅针对ie6有效*/

希望我的回答对您有所帮助,如有疑问,欢迎继续咨询我们。

IE8现在还没有很好的解决兼容性的办法,但是IE8有一个方式是可以降低到IE7版本浏览。就是在每个以完成的页面源码中添加这句话:<meta http-equiv="X-UA-Compatible" content="IE=7" />这样,我们做好的成品页面即使在IE8中测试不兼容,加上上面那段代码,就可以把IE8的兼容性视图降低至IE7,一切就正常啦!以下是css兼容IE6、IE7和FF的方法:区分IE6,IE7,firefox

区别不同浏览器,CSS hack写法:

区别IE6与FF:

background:orange*background:blue

区别IE6与IE7:

background:green !importantbackground: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能识别*,也能识别!important

FF不能识别*,但能识别!important