snix
snix

Reputation: 195

IE8 doesn't load CSS

I have written a new website template. All works fine but there is one problem:

IE8 and lower don't load my stylesheet. I have no idea why. I have tried it on multiple computers to eliminate the possibility of cache-problems or something like that.

The stylesheet is written with SASS (http://sass-lang.com/). But I think, this isn't the problem because I've made some other websites with SASS and everything works fine.

//EDIT:

<!DOCTYPE html>
<html lang="de">
    <head>
        <meta charset="utf-8" />
        <title>***</title>
        <link rel="stylesheet" type="text/css" href="/styles/screen.css" />
    </head>
<body>
</body>
</html>

Upvotes: 0

Views: 3000

Answers (2)

Maurice
Maurice

Reputation: 27632

You are using <section> elements that are new and IE8 doesn't know about by default. And because it doesn't know about them they are treated sort of like a span except you can't style them either using CSS.

The trick is to create the element before the page is is loaded and the browser can style them. The easiest way is to use something like html5shim. Just make sure to add the following code to your head section as it needs to run before the HTML starts rendering:

<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Upvotes: 7

Mr. Alien
Mr. Alien

Reputation: 157314

Some problem in your path I guess..

Possibility 1 :

<link rel="stylesheet" type="text/css" href="styles/screen.css" media="screen" />

Possibility 2 :

<link rel="stylesheet" type="text/css" href="../styles/screen.css" media="screen" />

Upvotes: 1

Related Questions