Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS styles not being loaded in IE8

I have a very strange issue in that no CSS styles are being loaded in IE8 (maybe IE7 as well but cannot check). My site is at http://www.leavetrackapp.com/ and my master CSS file is as follows:

@import url("reset.css");
@import url("screen.css");
@import url("site.css");
@import url("colorbox.css");

The master.css file and indidivual stylesheets are accessible if I directly enter the address in the browser e.g. http://www.leavetrackapp.com/stylesheets/master.css returns the main file.

I think it's a problem with the import rules but have no idea what it could be. Safari and Firefox work fine.

Any advice appreciated.

Thanks

Robin

like image 334
Robin Fisher Avatar asked Jun 27 '11 11:06

Robin Fisher


People also ask

Does CSS work in Internet Explorer?

CSS all property is Not Supported on Internet Explorer 10. If you use CSS all property and your users are using Internet Explorer 10, then they would see the feature properly. That doesn't guarantee that other web technologies are also compatible in Internet Explorer 10 though.

How do I add specific CSS to Internet Explorer?

#2 CSS Rules Specific to Explorer (IE CSS hacks) IE8 or below: to write CSS rules specificially to IE8 or below, add a backslash and 9 ( \9 ) at the end before the semicolon. IE7 or below: add an asterisk ( * ) before the CSS property. IE6: add an underscore ( _ ) before the property.


1 Answers

@Guffa put me onto the right track with this: the problem is that the HTML5 elements aren't working in Internet Explorer 8 and lower.

Modernizr would fix this, but: http://www.modernizr.com/docs/#installing

Drop the script tags in the <head> of your HTML. For best performance, you should have them follow after your stylesheet references. The reason we recommend placing Modernizr in the head is two-fold: the HTML5 Shiv (that enables HTML5 elements in IE) must execute before the <body>, and if you’re using any of the CSS classes that Modernizr adds, you’ll want to prevent a FOUC.

So, you simply need to move Modernizr from just before </body> to inside the <head> element.

like image 56
thirtydot Avatar answered Sep 27 '22 22:09

thirtydot