Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE 9 ignoring CSS rules

I have this weird issue with IE9 where it is ignoring certain CSS rules on its own. Even IE8 loads it correctly. So does IE 10 and all the nicer browsers like FF and Chrome.

The css is being loaded with "text/css" MIME.

For example,

These rules are not being applied by IE9. I cannot find these rules in the developer toolbar CSS tab.

.B2B .info_cart { display: block; clear: both !important; }
.B2B .info_cart .priceDetail { font: 14px/22px Arial,Helvetica,sans-serif; padding-left: 3px; }
.B2B .info_cart .priceInfo { bottom: 2px; font-size: 10px; line-height: 24px; margin: 0 0 0 2px; overflow: hidden; padding: 0; position: absolute; word-wrap: break-word; }
.B2B .info_cart .info_vat { font-size: 10px; float: right; margin-top: 7px; }

The relevant HTML:

<div class="info_cart clearfix">
    <span class="spanBasketInfo"></span>
    <span class="cartValue"></span>
    <span class="cartShippingDetails"></span>
    <span class="info_vat">
        <span class="exc">exc. VAT</span>
        <a href="#">(change)</a>
    </span>
</div>

What could be wrong?

UPDATE This is the Doctype I am using, if it helps.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="sv" xmlns="http://www.w3.org/1999/xhtml" class=" js no-touch borderradius boxshadow textshadow opacity cssgradients csstransitions">
like image 597
amit Avatar asked Jan 21 '14 11:01

amit


2 Answers

Finally got hold of the problem. IE cannot handle more than 4096 selectors in a stylesheet. Therefore it was ignoring all the style rules after it reached its limit of 4096 selectors.

After splitting the CSS file into two separate files, the problem was fixed.

like image 60
amit Avatar answered Nov 03 '22 18:11

amit


Verify that IE is not running in compatibility mode. I had a similar issue once before that caused IE9 to render as if it was IE7. I turned off compatibility mode and all of my problems were solved! If that is the issue, you can force IE to render without compatibility mode using the following meta tag in your head (go ahead and put it in your head and see if it resolves the issue for you):

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
like image 43
bboysupaman Avatar answered Nov 03 '22 19:11

bboysupaman