Website Rendering Problems in IE8?

Posted by Me (Kris Jay) & Written on Jan.08, 2010

hrbg

I've noticed lately while surfing the net with ie8 that there is the odd site I stumble accross that has problems rendering properly when not in 'Compadability' mode. Now some people might think it's a CSS problem, and sometimes it is. If it is, there is a simple fix by adding two different peices of code. First you need to create a CSS file called 'ie.css' for example, or you can name it whatever you want.

Within that CSS file put the following code:

body { text-align: center; }
#container { width: 950px; margin: 0 auto; text-align: left; }

*where it says 'container', change to what your main content <div> is called.
**where the 'width' is defined, change to represent your website's width.

Now you have to call the CSS file by adding a line of code in the <head> of your website. Simply add the following line of code, and you should be good to go:

<!--[if lt IE 8]>
<link href="http://www.yourwebsite.com/ie.css" mce_href="http://www.yourwebsite.com/ie.css" rel="stylesheet" type="text/css" /><![endif]-->

Sometimes that's not the full problem, and you can fumble around for hours combing through you CSS trying to figure out what's wrong. Now since I develop websites that need to be compadible accross all major browsers (including the dreaded Internet Explorer), and need them to display properly when surfers drop by for a visit there is a simple line of code (a <meta>) I drop into the <head> of the site that forces the 'Compadability' mode in the IE8 Browser, thus rendering it proper (only if you have the 'ie.css' file explained above linked in too) and allowing me to keep some of my hair.

The code is simple, and sweet. Just make sure you place it right after the <head> tag, before any other <meta> tags. The reason for placing it before any other <meta> tags is because IE8 will sometimes completly ignore the command if placed after current tags.

Here's the code:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

Like I said, Simple and Sweet! Hope you saved a little of your hair too.....

hrbg

I Have Written 45 Posts So Far!

hrbg
Getting The Latest Tweet...
hrbg
Looking For Custom WordPress Web Development? Contact Graphic Dreams Studio

hrbg

the tags: , , , ,

hrbg
» «
hrbg
Creative Commons License

7 Comments for this entry

Leave a Reply


hrbg

Grunge Style Backgrounds – Download

The second thing I'm tossing out for download tonight is a pack of 24 Grunge-Style backgrounds in a nice little .zip (well 31.5 MB's) for you to snag. Each back...

read more

Blood Splatter Screensaver – Dexter

Popping on today because I was a little bored at work, so I figured I'd make something to give away and be able to use myself. If you know me, you know that I l...

read more

Carbon Fiber Texture

Here is a carbon fiber texture that could be used for backgrounds, or chopping up to use for smaller projects. The file is 1000px by 1000px, so it gives you som...

read more


Cmin.us Social Bookmarks – WP Plugin

Cmin.us Social Bookmarks WordPress Plugin simplifys the way you and your surfers get ShortURLs and Submit Your Posts to Social Media/Bookmarking Sites.The Plugin places a...

read more

Author Tweets – WordPress Plugin

This is a WordPress Plugin for multi-author, and personal websites/blogs. It displays the 'About the Author' box at the end of all posts, with a Twitter Twist. I have com...

read more

WordPress Tetris – WordPress Plugin

This Plugin is just for fun, and can take up a bunch of your time once you start playing. Everyone knows/has played the game Tetris, well I decided it was time that WordP...

read more




"Ignorance is the foundation of atheism, and freethinking the cure of it"
Anthony Collins - 1676-1729