Force IE8 to load in IE8 mode

The way IE works is, when IE8 loads your page, if it thinks that there are some issues on the page, it loads the page in IE7 mode. Stupid, right. That’s what I think too.

Here is how to force IE8 to load the page in IE8 mode no matter what and not load it in IE7.

1. Replace your doctype with HTML5 one

Source code    
<!DOCTYPE html>

2. Add Meta tag right under your <html> tag that tells the browser to render this page in IE8 mode. Make sure it’s the first line after <html> tag

Source code    
<html>
<meta http-equiv="X-UA-Compatible" content="IE=8" ><!-- as the vey first line after html-->
    <head>