Force CSS in IE

2

I have a widget on my page and it is reading an external CSS, I would like it to load my CSS as the main one in Internet Explorer 11. All other browsers load normally, but I need IE to work.

I used "! important" in css and still did not succeed.

    
asked by anonymous 08.12.2015 / 18:06

2 answers

4

Unfortunately, it seems that the old implementations of CSS in Internet Explorer do not allow you to use !important in a conventional way.

If you simply override or update a attribute will not work . This will only work if you are using Media Queries, such as to make a responsive website.

In reality, the "correct" would be you do not need to override using !important , but instead use a class hierarchy.

For example:

.class1 {
color: #555 !important;
}

.class1 {
color: #FFF;
}

.class1 {
color: #000;
}

The color that Internet Explorer will interpret will be # 000, because it is the one that comes later and therefore it overlays the previous ones.

    
08.12.2015 / 19:06
1

You can have two style sheets and use one for IE and other for other browsers.

<!--[if IE]> <link href="somente_ie.css" rel="stylesheet" type="text/css"> <![endif]-->
<!--[if !IE]> <link href="geral.css" rel="stylesheet" type="text/css"> <![endif]-->
    
08.12.2015 / 19:11