0
votes

I just started using cakephp and upto so far everything is going well, but my problem is that i want to have an IE6 specific stylesheet, i have been doing this for quite sometime with just normal HTML but if i try to do it in cakephp is doesn't put the stylesheet.

My code for outputting the IE6 stylesheet inside the default.ctp is

 <!--[if IE 6]>
    <?php echo $this->Html->css('ie6');?>
 <![endif]-->

I have my stylesheets under webroot/css/ie6.css

Can anybody tell me what i might be doing wrong.

Thanks Dee

1
This should work just fine. Does it get included properly if you drop the if IE 6 tag? - Oldskool
all the other stylesheet(main stylesheet) works fine, IE6 just takes the main stylesheet even if i include those tags. - Dee-M
post some CSS from your main stylesheet, and the CSS from your ie6 one that should replace it - perhaps there are some problems there instead. - Ross
@Dee-M It should take the main stylesheet. Your ie6.css should contain specific IE6 overrides to your main stylesheet in order to fix IE6 glitches. It's not like using those tags prevent the main stylesheet from being loaded at all. - Oldskool

1 Answers

0
votes

When I add that code to my CakePHP project I get this output

<!--[if IE 6]>
   <link rel="stylesheet" type="text/css" href="/css/ie6.css" />    
<![endif]-->

So it appears to be working fine. You might want to check if the file is actually at the right place (try to append /css/ie6.css behind the URL of the page you're looking at and see if it returns a 404 or your CSS file).

Nothing wrong with the conditional comment too, so my guess would be a file error.