I am very new to Magento. Recently I have to add extra styles to my magento website. So I go to adminpanel -> content-> design->configuration->my theme ->HTML Head

I add the following line

<link rel="stylesheet" type="text/css" media="all" href="https://example.com/my-style/style.css" />

Then I save that one. Now new styles are working on my website. But I edited some of the styles through opening the file through Filezilla and edit. After that, I uploaded. Then I noticed that new changes are not coming. So I open https://example.com/my-style/style.css in a browser so I can see that it is not updated the copy. I refresh the page and I open in incognito window. Still the same. But when I open in the same file through editor using FileZilla I can see that it is updated copy.

Then I try to refresh page cache, layout cache but the result is the same.

i am using FileZilla for accessing the file . i don't have the terminal . Please help

  • try sudo rm -rf var/cache/* generated/* pub/static/* php bin/magento setup:di:compile php bin/magento setup:upgrade – Shafeel Sha Jul 30 '19 at 8:51
  • i dont understand. this is any command line ? whee i have to execute ? – John Jul 30 '19 at 9:57
  • did you try after clear cache/ generated and static folders ? – Shafeel Sha Jul 30 '19 at 10:03
  • no . Because i dont know how to do that . I try to refresh page cache, layout cache . – John Jul 30 '19 at 12:34
  • please check answer – Shafeel Sha Jul 30 '19 at 13:20

As you've said that, you've inserted the CSS file directly on in the header which is placed under /var/www/html/my-style/style.css.

You need to flush the CDN and Server caches as well if they are enabled on the website.

As you've shared, your site has enabled the Cloudfare, then you need to flush the cache for the below path from Cloudfare


Also, you can add a custom CSS file in your theme by adding a CSS file to the below path:


Include the created file by adding it to /app/design/frontend/[vendor]/[your_theme]/Magento_Theme/layout/default_head_blocks.xml with below content.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <css src="css/your_css_file.css" />

Below is the official guide to include custom CSS files in your theme.


Hope it helps!!!

| improve this answer | |
  • ok . could you please suggest the good path & method to put new style sheet in my website . – John Sep 2 '19 at 8:06
  • I've updated my answer, please have a review. – Sumit Sep 2 '19 at 8:49
  • 1
    very useful information . thank you very much – John Sep 2 '19 at 8:57
  • You're welcome, John. Happy coding!!! – Sumit Sep 2 '19 at 8:58
  • 1
    before i am searching for official magento documentation , that time i didn't find out . But now you helped me to get the documentation . Really thank you . – John Sep 2 '19 at 9:01

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.