Reputation: 29
I am learning MVC 4 and am using one of the tutorial projects I've found. I'm at the point now where I'd like to play with styles, but am bewildered. I thought changing a style in site.css
would do the job, but no matter what I do it's ignored. Here is the really weird part, though - when I delete the contents of site.css
and run the project, everything looks like it did before I deleted the style code. I realize that I don't yet fully understand specificity, but Firebug tells me that the styles are coming from site.css
.
Can anyone tell me how this could be?
Upvotes: 2
Views: 4562
Reputation: 451
The web browser download web pages and store them locally in your computer, in cache memory. When you visit the second time that page, the browser loading the page locally from cache and not downloading everything again.
Sometimes we need to manually delete the cache because the browser fails to recover the most recent copy available on the Site. I'll show you how to do it in 2 ways
The difference between them can be found at this link:
Upvotes: 2
Reputation: 167162
This looks like the CSS has been cached by the browser. What you can do if this is the issue is:
You can check the source of the Site.css
file by opening the URL from the browser and verifying the contents. If the contents are old and not updated, you can press Ctrl + F5 on the Site.css
page to find the updated file and then pressing just F5 will display the updated styles.
Most common way to handle this in Visual Studio is:
Upvotes: 4