CSS file not refreshing in browser

前端 未结 15 1270
旧时难觅i
旧时难觅i 2020-11-29 04:55

When I make any changes to my CSS file, the changes are not reflected in the browser. How can I fix this?

相关标签:
15条回答
  • 2020-11-29 05:21

    Have you tried renaming the new version of your CSS to CSSv2.css and then directing your page to use that? If that solves the stale-file issue, then you're just experiencing non-refreshing files. If not, you've got bigger issues.

    0 讨论(0)
  • 2020-11-29 05:22

    This sounds like your browser is caching your css. If you are using Firefox, try loading your page using Shift-Reload.

    0 讨论(0)
  • 2020-11-29 05:24

    If you're using ASP.NET web forms, make sure that you are using the right theme:

    I just spent about an hour trying to solve this!

    0 讨论(0)
  • 2020-11-29 05:24

    The Ctrl + F5 solusion didn't work for me in Chrome.

    But I found How to Clear Chrome Cache for Specific Website Only (3 Steps):

    1. As the page is loaded, open Chrome Developer Tools (Right-Click > Inspect) or (Menu > More Tools > Developer Tools)
    2. Next, go to the Refresh button in Chrome browser, and Right-Click the Refresh button.
    3. Select "Empty Cache and Hard Refresh".

    Hope this answer helps someone!

    0 讨论(0)
  • 2020-11-29 05:25

    I had this issue, I was scratching my head for the best part of two days.

    Turns out I completely forgot I had CloudFlare setup on the domain I was live testing on.

    CloudFlare caches your JavaScript and CSS. Turned on development mode and BAM!

    Seriously... two whole days.

    0 讨论(0)
  • 2020-11-29 05:27

    Is this a local custom CSS file? Is this your website? Maybe you should clear your cache.

    Also the last CSS declaration takes precedence.

    0 讨论(0)
提交回复
热议问题