I want to add some CSS files. So I created a child theme.

In Backend the theme is activated.


<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">


<?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">
        <css src="css/styles.css" />
        <css src="css/paymentfont.min.css" />

CSS files

  • web/css/styles.css
  • web/css/paymentfont.min.css

I cleared the cache, deployed the static data and also reindexed. The static files were created but not included.

Any ideas?

  • I am having the same problem, and so far am not sure why it is occurring. The layout blocks will only extend or override certain XML files (Smartwave_Porto module layout files) and instantly shows changes but any others I've tried are completely ignored.
    – Adad64
    Commented Aug 8, 2017 at 22:26
  • In pub/static folder find where is paymentfont.min.css file? Commented Jan 3, 2020 at 5:01

2 Answers 2

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
    <css src="css/styles.css" />


Add your CSS in yourtheme/web/css path and run Deployed content.

That's it.

  • The CSS files are in the following folder: app/design/frontend/Customvendor/customtheme/web/css
    – cdx
    Commented Jul 6, 2016 at 15:11

I thought this might help as I'm using the same theme. I had couple of issues but finally got my child theme working. Here is my folder structure:

app/design/frontend/vendor/{parent_theme}_child consists of the follow folders:








Here is the debug:

  • If you child theme is enabled in admin, then the registration is working, otherwise double check your registration.php and theme.xml.
  • Make sure style.css in the right folder, some tutorials suggest put style.css in child_theme/css/, this doesn't work for me. It needs to
    be in child_theme/web/css/.
  • Make sure default_header_blocks.xml in the right folder. Nikul's answer missing close </page> tag.
  • Give correct file (644) and folder permission(755) to your child theme.
  • Turn developer mode on, it helps in case of syntax issues.

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.