仅将css样式应用于ie9 [英] Apply css styles only to ie9

查看:414
本文介绍了仅将css样式应用于ie9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站我有一个文件(ie.css)来纠正的css问题的ie。
然而,现在我有一个litte问题。网站的一些默认样式是好的ie8,而不是ie9。

im my website i have a file (ie.css) to correct css problems of the ie. However, now i have a litte problem. Some default styles of the website are good on ie8 and not on ie9.

所以,我想应用跟随css代码里面的文件ie.css到版本9,是可能吗?

So, i would like to apply the follow css code inside the file "ie.css" only to the ie version 9, is that possible?

.ngg-galleryoverview {
    overflow: hidden;
    margin-top: 10px;
    width: 100%;
    clear:both; 
    display:block !important;
    /*border: 2px solid #ADE132;*/
    /*margin-left: 10px;*/
    margin-left: 2%;
}

.ngg-gallery-thumbnail {
    float: left;
    margin-right: 3%;
    /*margin-right: 10px;*/
    text-align: center;
    /*border: 2px solid #ADE132; */
    height: 430%;
    width: 430%;
}


推荐答案

是设置一个body类只为IE9,当你想修改你的css它会开始,该类前面任何其他html标签或类。这将保证您的css是w3c兼容。

The best way to do this is to set a body class only for IE9 and when you want to modify your css it will begin wit that class in front any other html tag or class. This will guarantee that your css is w3c compliant.

以下是代码:

<!--[if IE 9 ]>    <body class="ie9"> <![endif]-->

这篇关于仅将css样式应用于ie9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆