Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my CSS not updating in web browser? [closed]

Tags:

css

When coding my website, I save HTML and CSS docs then refresh my browser to see the changes. However when I refresh the HTML changes are seen but the CSS changes aren't. Instead what I would have to do is close the window and reopen it again to see my CSS changes.

Any ideas why I cant just refresh and see the CSS changes instead of closing the window and reopening?

like image 424
Michael Sórm Avatar asked Aug 31 '13 02:08

Michael Sórm


People also ask

Why is my CSS not updating on my website?

Browser Cache If you are adding/modifying in-line CSS or JavaScript and not seeing the changes reflected in the HTML source, the page is likely being cached. The solution may be to purge the WordPress object cache, which stores our page caching (Batcache) renders.

How do I force a browser to refresh CSS?

Anytime you make changes to CSS, JavaScript and are viewing the page you've updated - you will see this concern. You can force a refresh by pressing CTRL+F5 on the browser and that will get the latest version.

Why isn't my CSS changes are not reflecting?

The most common reason is that your CSS file is cached by your browser. To fix this, try force refreshing your browser (Ctrl + F5). If that doesn't work, try clearing your browser's cache. Another possible reason is that you have not uploaded the CSS file to the correct location on your server.

Why is my stylesheet not updating?

Most probably the file is just being cached by the server. You could either disable cache (but remember to enable it when the site goes live), or modify href of your link tag, so the server will not load it from cache.


1 Answers

Try a "hard" refresh of your browser...

http://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache

The idea is to bypass your browser's cache. Different browsers handle this differently, and this wiki article has a nice walk-through for each major browser on how to do this.

Alternatively, you could clear your browser's cache, which is also covered by the wiki article.

like image 199
Hristo Avatar answered Oct 14 '22 17:10

Hristo