2 replies [Last post]
Sargas
Sargas's picture
Offline
newbie
Last seen: 9 years 27 weeks ago
Timezone: GMT+2
Joined: 2012-07-07
Posts: 2
Points: 3

Hello everyone, I'm new here Smile

So, I specifically looked up this forum to get this problem sorted. It's the classic IE stylesheet issue - but with a twist.

So I've finished the design of my website (using Google Chrome), and got rather pleased with it, so now it's time to make it work in IE (works fine in Chrome, Safari, Opera and Firefox). So I went googling for the IE-specific stylesheet code that I needed, found it, and pasted it into my code.
Just to make sure everything was working, I changed the background from my lovely picture to the screaming green color, and I started up my site.

The background was green for half a second, then changed back to the picture.

So I tried uploading it to my public folder on DropBox, to see if its behavior changed when going online.
At first, it seemed as though it did, and I shouted out in joy! Then 4 seconds later, it changed back again....

Here's a link to my site: https://dl.dropbox.com/u/67912330/Hemsida/Index.html

And here's the code:

<head>
<!--[if gte IE 9]>
<link rel="stylesheet" type="text/css" href="style/IE.css" />
<![endif]-->
 
 
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen">
</head>

I've tried adding an additional to the standard stylesheet, but then Chrome didn't read it either...

Any help would be highly appreciated Smile

Thanks in advance.

Sargas.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 3 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Hi Sargas, There's a couple

Hi Sargas,
There's a couple of steps to take when you are having issues, I explain them in Debugging CSS problems.

You need to add a valid doctype eg: <!doctype html> so that IE renders in standards mode. You will be more likely to have the same rendering in IE as in other browsers with one.

Validate your styles and your markup and fix any issues you can.

The order of style declarations is important, so is the order of stylesheets. Your IE styles come before the others so IE will see it's stylesheet then see the normal stylesheet and overwrite the values.

Sargas
Sargas's picture
Offline
newbie
Last seen: 9 years 27 weeks ago
Timezone: GMT+2
Joined: 2012-07-07
Posts: 2
Points: 3

I tried that out real quick,

I tried that out real quick, and it seems to have the potential of solving my issue. Thank you Smile

EDIT: Took some time to fix most of the issues found through your links, and now everything works perfectly in all browsers, including Internet Explorer!
Big thanks! Laughing out loud