SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Sep 25, 2006, 11:04 #1
- Join Date
- Jan 2004
- Location
- Seattle
- Posts
- 4,328
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Problem with Conditional Comments for IE
If you view any of the following pages with Firefox, then Internet Explorer, you'll see some navigation links in the top left corner of the page in Firefox, but nothing in IE:
http://www.geobop.org/World/Arizona
http://www.world.org/Arizona
http://www.geozoo.org/World/Arizona
http://www.geosymbols.org/World/Arizona
http://www.politix.us/World/Arizona
I haven't been able to figure out how to fix it, but I'd at least like to stop jerking Firefox around while trying to solve it. So I decided to use a conditional comment to display a CSS style for IE only. But it doesn't seem to work.
To test it, I inserted an outrageous style...
body ( font-size: 250% )
It works in both Firefox and IE if I remove the conditional comments. But with the conditional comments, it doesn't work in either one. So I guess I'm not writing my conditional comment tags correctly. Can someone show me how you do yours?
This is what I have in my HTML:
PHP Code:echo '<!--[if gte IE 5]
<link href="'.$BaseURL.'/a1/css/microsux.css" rel="stylesheet" type="text/css" />
[endif]-->';
?>
PHP Code:<!--[if gte IE 5]
<link href="http://www.geobop.org/a1/css/microsux.css" rel="stylesheet" type="text/css" />
[endif]-->
PHP Code:<!--[if gte IE 5]
<link href="/a1/css/microsux.css" rel="stylesheet" type="text/css" />
[endif]-->
-
Sep 25, 2006, 18:39 #2
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
They're wrong. You're missing <! before the endif.
PHP Code:<!--[if gte IE 5]
<link href="/a1/css/microsux.css" rel="stylesheet" type="text/css" />
<![endif]-->
-
Sep 25, 2006, 19:03 #3
- Join Date
- Jan 2004
- Location
- Seattle
- Posts
- 4,328
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Raffles
Don't you think you could have just typed "conditional comments" into google and found this out for yourself?
-
Sep 25, 2006, 19:50 #4
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
I didn't notice you're also missing the > from the opening tag. It should be:
Code:<!--[if gte IE 5]> <link href="/a1/css/microsux.css" rel="stylesheet" type="text/css" /> <![endif]-->
Bookmarks