Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-05-2007, 11:48 AM   PM User | #1
peterworth
New to the CF scene

 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
peterworth is an unknown quantity at this point
stylesheet link in conditional comments for ie

because the * html thing doesn't seem to work in ie7, i'm trying to do this instead:

Code:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="../iehacks.css" />
<![endif]-->
but nothing happens at the moment. the strange thing is that if i take the conditional comments away, then the stylesheet loads and works fine, so that can't be the problem, but likewise the conditional comments can't be the problem because if i put some text inside them, it appears in ie and not in firefox, as it should. any ideas why the 2 together doesn't work? thanks.
peterworth is offline   Reply With Quote
Old 07-05-2007, 12:00 PM   PM User | #2
Jutlander
Regular Coder

 
Jutlander's Avatar
 
Join Date: Jun 2007
Location: In my own sick little world :P
Posts: 425
Thanks: 1
Thanked 12 Times in 12 Posts
Jutlander is on a distinguished road
The * html hack only works on IE 5 and 6 yes.

That should work... a link to your page would be nice, cause then we can see how your site is set up.
__________________
.
.
Jutlander is offline   Reply With Quote
Old 07-05-2007, 12:20 PM   PM User | #3
peterworth
New to the CF scene

 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
peterworth is an unknown quantity at this point
yeah, it should work.. but it doesn't

sorry, site isn't up yet. it's a dreamweaver thing with templates so there are editable regions dotted around, but if i do view source, the whole head of the page is just this:

Code:
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>test page</title>
<!-- InstanceEndEditable -->
<link rel="stylesheet" type="text/css" href="style.css" />
<!--[if IE]>
hullo.
<link rel="stylesheet" type="text/css" href="../iehacks.css" />
<![endif]-->
<script type="text/javascript" src="drop_down.js"></script>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
the "hullo." appears in ie and firefox, but the iehacks stylesheet gets applied to niether.
peterworth is offline   Reply With Quote
Old 07-05-2007, 12:26 PM   PM User | #4
Jutlander
Regular Coder

 
Jutlander's Avatar
 
Join Date: Jun 2007
Location: In my own sick little world :P
Posts: 425
Thanks: 1
Thanked 12 Times in 12 Posts
Jutlander is on a distinguished road
It's difficult without a live page, but your link to the IE stylesheet goes one directory up, try removing the ../ part?
__________________
.
.
Jutlander is offline   Reply With Quote
Old 07-05-2007, 01:40 PM   PM User | #5
peterworth
New to the CF scene

 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
peterworth is an unknown quantity at this point
ah but that's the interesting thing - there's nothing wrong with the link, because if i take away the conditional tags, then the stylesheet gets applied fine. i'll try taking them away anyway..
peterworth is offline   Reply With Quote
Old 07-05-2007, 01:44 PM   PM User | #6
peterworth
New to the CF scene

 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
peterworth is an unknown quantity at this point
having said that, it seems to have worked now that i've taken out the ..

i don't understand it, it must be something to do with dreamweaver - when inside the conditional tags, the local directory is different for some reason. weird.

anyway, i'm glad it's working. thanks for the help!
peterworth is offline   Reply With Quote
Old 07-05-2007, 02:29 PM   PM User | #7
Jutlander
Regular Coder

 
Jutlander's Avatar
 
Join Date: Jun 2007
Location: In my own sick little world :P
Posts: 425
Thanks: 1
Thanked 12 Times in 12 Posts
Jutlander is on a distinguished road
__________________
.
.
Jutlander is offline   Reply With Quote
Old 07-05-2007, 08:36 PM   PM User | #8
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Those conditional comments ONLY work in Internet Explorer. To Dreamweaver the whole thing is a comment just the same as in Firefox, Opera, or Safari.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:41 PM.


Advertisement
Log in to turn off these ads.