How do I hide a peice of html code from internet explorer so only mozilla firefox will read the code?
November 11th, 2009 | by admin |How do I hide a peice of html code from internet explorer so only mozilla firefox will read the code?
Purple Moogle is right, but he/she has written the wrong codes down.
Instead of:
<![if !IE]>
<link rel="stylesheet" type="text/css" href="css/not-ie.css" />
<![endif]>
It should be:
<!–![if !IE]>
<link rel="stylesheet" type="text/css" href="css/not-ie.css" />
<![endif]–>
Tags: Endif, html code, Internet Explorer, Link Rel, Lt, Moogle, Mozilla, Peice
By KaosuM on Nov 11, 2009
Easiest way to think of is have a browser test, if the browse is firefox, redirect to a page with the firefox friendly code and redirect IE else where. But you really cannot hide code on a page from a specific browser.
References :
By Purple Moogle on Nov 11, 2009
IE has a method of hiding/enabling code based on browser version but can also be used to ignore code.
<![if !IE]>
<link rel="stylesheet" type="text/css" href="css/not-ie.css" />
<![endif]>
Internet Explorer will ignore this while all other browsers will ignore the if tags (since they’re just comment tags intepretted by IE) and will link the stylesheet. This way you can use ‘display: none;’ on anything you want IE to hide and then ‘display: block;’ them back in in the non-IE style.
References :
By Mark aka jack573 on Nov 11, 2009
Purple Moogle is right, but he/she has written the wrong codes down.
Instead of:
<![if !IE]>
<link rel="stylesheet" type="text/css" href="css/not-ie.css" />
<![endif]>
It should be:
<!–![if !IE]>
<link rel="stylesheet" type="text/css" href="css/not-ie.css" />
<![endif]–>
References :
http://answers.yahoo.com/question/index;_ylt=AnX44kXMZEOmtDAthyh8CmTsy6IX;_ylv=3?qid=20090928101911AA0FBNm