0

I got the answer in this link

it's working only in the home page I needed it to work in each and every page please help me with this

1
  • Hi Punith, welcome to Magento stackExchange. It seems that, you are asking the same question again which makes this question a duplicate. magento.stackexchange.com/questions/260314/… . You can continue with the original question where you have an answer there. If it still not helping to resolve your issue, then feel free to update that question or ask a new question Feb 4, 2019 at 6:32

2 Answers 2

0

File: app/design/frontend/[Package]/[Theme]/Magento_Theme/layout/default_head_blocks.xml

Css path: app/design/frontend/[Package]/[Theme]/web/css/custome.css

<?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <head>
           <css src="css/custome.css"/>
           <css src="css/style-l.css"/>
        </head>
    </page>
4
  • If add the custome.css in default_head_blocks.xml it will add the ustome.css after the style-l.css but I need it before style-l.css
    – Punith
    Feb 4, 2019 at 6:23
  • <css src="css/style-l.css"/> then <css src="css/custome.css"/> Feb 4, 2019 at 6:25
  • i update my answer check it Feb 4, 2019 at 6:26
  • @Punith please check my answer is working fine then accpet. Feb 11, 2019 at 10:58
0

You can do this by reordering the code in the layout manually

THEME\Magento_Theme\layout\default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/your-custom-file.css"/>

        <css src="css/styles-m.css"/>
        <css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
    </head>
</page>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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