html - Is it wrong to use "if IE" conditional comment to control what content is displayed? -


i have simple html login form in want display users internet explorer (as per existing design, not choice) , display error message when accessed other browser.

my question is, how wrong use <!--[if ie]> tag in body determine content show, if @ all? there drawbacks using this?

login.html

<html> <head>   ... </head> <body>    <!--[if ie]>     <form>       ...     </form>   <![endif]-->    <![if !ie]>     site can accessed via internet explorer   <![endif]-->  </body> </html> 

i aware can use javascript, css or server-side things perform this, want change code , design minimally possible , quite curious drawbacks of above method.

according msdn, conditional comments not supported in standards mode of ie 10.

http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx

that said, if supporting browsers need using them go it. don't surprised if phased out going forward.

also, syntax wrong on not ie comment. should 2 comments other browsers handle correctly.

<!--[if !ie]-->     site can accessed via internet explorer <!--[endif]--> 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -