0

I'm really new to Magento and really confused of what's going on in there. I need to fix IE 8 bugs so I create a new css file in my theme directory. I link the css file in the head.phtml with conditional css comment. So far so good. I clean all the cache, browser, magento. Disable the css files merge, flushing css cache. I see that the declaration "" is in the header. But when I write something in the file and refresh the page in IE 8 (in compatibility mode) changes does not take effect. I need some help guys. Thanks in advance!

This is what I've added to my head.phtml file:

<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="/skin/frontend/ft001-sofia/mod/css/ie8-fix.css" media="all" />
<![endif]-->

Here's the website. You can see the head with Inspect Element:

http://dev.elmaira.bg/
  • Can you add a snippet of code of the way you've added it in the head.phtml, maybe a screenshot of the page source and what you tried to change – Sander Mangel Jan 27 '15 at 21:20
  • Yes, sure. Look at my post. I'll add it! – noSpoon Jan 27 '15 at 21:33
  • maybe stating the obvious but are you sure the CSS is being loaded? – Sander Mangel Jan 27 '15 at 21:43
  • I'm not sure. How I can be sure about that? – noSpoon Jan 27 '15 at 21:45
  • You can use the dev tool or firebug for IE – Sander Mangel Jan 27 '15 at 21:46
1

Editing the template file directly isn't the best option. You can define them via XML this way :

<action method="addItem">
    <type>skin_css</type>
    <name>css/styles-ie.css</name>
    <params/>
    <if>lt IE 8</if>
</action>

There should already be some pre-defined in page.xml if you need an example.

  • In my theme I have no page.xml file, I've got a local.xml file. Where should I exactly add it? – noSpoon Jan 27 '15 at 21:35
  • If you don't have a <default> section already, add one. <default><reference name="head">...the...code...above</reference></default> – Mayers Jan 27 '15 at 21:48
  • I did exactly what you said and it still does not work. – noSpoon Jan 27 '15 at 21:58
  • 1
    @noSpoon make sure the <default> node you created is sitting within the XML's main <layout> node if it is not already. – Darren Felton Jan 27 '15 at 23:28
0

I have made plenty of fixes for IE and have always made them in the head.phtml

Maybe you should try and loading a js alert in the head.phtml like the following so we know that your css call is not the problem and make sure we are working with the correct head.phtml file.

<!--[if IE 8]> 
<script>
alert("I'm indeed using IE!");
</script>
<![endif]--> 

I know another person commented that you should check and see if your css call is indeed working and loading the css you're trying to call. This should help us narrow down the problem.

Let me know if this works

  • Okay. I copied it and paste it into my head.phtml in the current theme and it didn't worked. So I considered that's not the right head.html file and I've tryied all the head.phtml files that I saw. But it remains the same. I also tried changing the IE version to see if there's a problem around that, but still the same. I have doubts in the IE compatibilty mod, but not sure... Thank you for the efforts! – noSpoon Jan 28 '15 at 10:14
  • no worries, Maybe try it without the conditional comments just to see which head.phtml is the right one. Also you may want to make sure your cache is turned off and any other full page cache you may have running on your site. – WadeO Jan 28 '15 at 14:47
  • also I took a look at the page source and found the following conditional comments for IE7 maybe search your code and see where this is being applied.<!--[if lt IE 7]> <script type="text/javascript"> //<![CDATA[ var BLANK_URL = 'dev.elmaira.bg/js/blank.html'; var BLANK_IMG = 'dev.elmaira.bg/js/spacer.gif'; <link href="dev.elmaira.bg/skin/frontend/ft001-sofia/mod/css/ie6.css" rel="stylesheet" type="text/css" /> //]]> </script> – WadeO Jan 28 '15 at 14:51
  • No. Conditional comment does not work, declaring the style sheet in the local.xml, page.xml file doesn't work too. If I remove the comment tags, it all works......... – noSpoon Jan 28 '15 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.