Detecting IE10 and IE11Browsers

Since IE10, browser detection tags such as (.ie or .ie9 etc) are no longer support to identify the version of the IE browser. As a matter of fact, IE is no longer even recognized as an IE browser. Instead, if you search for the User-Agent in your request header, you will see that IE10 and IE11 have a User-Agent of a Mozilla Browser: “User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko”

ie11

I thought that this means, all rendering should look like any other Mozilla rendering (Firefox). However, it was not the case. I needed to specify a certain css styling only for IE10+ browsers and could not seem to find a way of doing so without using JavaScript.

Paste the following code between script tags at the end of your page before the body closing tag:

if (document.body.style["msScrollLimit"] == undefined){
//NOT IE10+ Browser
alert("You are not using IE10 or IE11");
}
else if (document.body.style["msScrollLimit"] != undefined){
//IE10+ Browser

    //msTextCombineHorizontal is a css property only accepted using IE10+
if (document.body.style["msTextCombineHorizontal"] == undefined){
//IE10 Browser
alert("You are using IE10");
}
if (document.body.style["msTextCombineHorizontal"] != undefined){
//IE11 Browser
alert("You are using IE11");
}
}

View Live Demo Here.

Goodluck 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s