Magento 1.9 – Add Custom CSS File to Head

cssmagento-1.9

I need to add a custom CSS file to Magento that then is used site-wide. I know you have to add this to a local.xml file, however, the stylesheet I add is just not loaded.

Anyone that can help?

Here is what I've added to my local.xml file:

<?xml version="1.0">
<layout>
    <default>
        <reference name="head">
            <action method="addCss”><type>skin_css</type><file>css/javcustom.css</file></action>
        </reference>
    </default>
</layout>

I know there are a lot of topics on this here, but I've tried all of them and I just can't get it to work…

Best Answer

There are two way to add css to head one is using function addCss and another is addItem. You have mix-up two format. Your format is wrong.

try this

<action method="addCss">
    <stylesheet>css/javcustom.css</stylesheet>
</action>

instead of

<action method="addCss">
    <type>skin_css</type>
    <file>css/javcustom.css</file>
</action>

or try this

<action method="addItem">
    <type>skin_css</type>
    <name>css/javcustom.css</name>
</action>
Related Topic