1

My problem is:

I have an html file and an external css file, which I have linked to the html file. Everything worked and I was able to make changes in my css file and it was displayed on the website. But suddenly no more changes were shown. I thought I had a mistake in my syntax and commented it out. But then suddenly no changes got displayed. So I commented out code that was already working and the website didnt responded. I then commented everything out in the css file but nothing happened, the website continued to display my css styles. I checked my code with a right click and looked at the css file in the browser and it still showed the old css file. I reloaded the page and my new css file where shown, where everything was commented out but the browser is still not responding. I restarted the xampp server and the browser (google chrome) several times and still nothing happened. After restarting several times more, my changes became visible. It wasn't the first time that happened and I wanted to know if anyone knew what could be the reason.

Waaal
  • 57
  • 6
  • try incognito mode or enable 'disable cache' in network tab – Harshit May 09 '20 at 11:29
  • Does this answer your question? [CSS changes are not getting reflected. Why?](https://stackoverflow.com/questions/28235731/css-changes-are-not-getting-reflected-why) – Imanpal Singh May 09 '20 at 11:32

3 Answers3

1

CSS rules are often stored in your cache, which will only update periodically. To ensure you are loading the latest CSS rules do a hard refresh of your page by using Ctrl + Shift + R (Windows) or Cmd + Shift + R (Mac) on your browser.

fraggley
  • 1,215
  • 2
  • 9
  • 19
0

I think that doing a hard refresh in your browser will work. If you are on chrome you can do ctrl+f5.

Rohan Nagmoti
  • 31
  • 1
  • 7
0

I know of a few options:

  1. CTRL + SHIFT + R

  2. CTRL + F5

  3. In Chrome- Right-click, Inspect Element, Right Click refresh, Empty Cache and Refresh

  4. In Chrome- RIght click, Inspect Element, Navigate to Network tab, Tick the "Disable Cache" checkbox, now restart chrome

Sam_
  • 86
  • 5