style.css not working but style_copy.css is working - html

I have been building a website for over a month now, nearly completed. All of a sudden, when I make a change to my style.css file, the change does not appear when I refresh the page in the browser.
The strange thing is that, if I make a copy of the file, called style_copy.css, and link to that and make changes, then the changes do appear in the browser.
Does anyone have a clue as to why this is occurring?
I am browsing on Google Chrome (94.0.4606.61) and editing in Visual Studio Code (1.61.0)
Thanks

First, make sure the css file has been saved.
If the file is already saved, then the issue is most likely because your browser has cached (saved an old version of) the file.
Then, try restarting the browser to clear the cache.
Also, try waiting and reloading, the file will likely update by itself pretty soon.

Instead of restarting the browser, you could also hit CTRL + F5

Related

Browser can not longer see saved CSS

So I was working on a page for the last week, every time when I end my job I save my files and close VSCode. Today I came back, opened everything and started writing. After a while I noticed that my rules in CSS did not came up in the page. I thought I did something wrong, so I tried different methods but nothing worked. Then I just opened the CSS in browser with F12 to check if something is off and I saw that it had the last weeks saved CSS. I closed everything, tried again, but nothing. The file is saved in local, I can see when it was changed, but browser still gets to see the last week's save. The link in HTML is right, never changed, the files are in correct folders, all is good. I'm working with WordPress and Twig atm, if this can help somehow.
<link rel="stylesheet" href="{{site.theme.link}}/style.css" type="text/css" media="screen" />
That's the link I used til now, it worked perfectly, paths never changed.
I'm sorry that I can't provide anything more but I can't really know what to show, like I changed nothing and it just stop working.
Thank you in advance for the time you'll take to help!
I suggest you to reinstall Mozilla Firefox. Follow these steps:
Backup your bookmarks (if you have any).
Take a screenshot of Add-ons page. It will help you to find and reinstall them.
Uninstall Firefox.
After uninstalling Firefox remove these folders:
C:\Users\[your-user-name]\AppData\Local\Mozilla
C:\Users\[your-user-name]\AppData\LocalLow\Mozilla and
C:\Users\[your-user-name]\AppData\Roaming\Mozilla.
If you have installed add-ons before uninstalling try this option:
Menu -> Help -> Restart with Add-ons Disabled
Could it be a caching issue?
Try opening dev tools and then right clicking the refresh button.
It will give you an option to clear cache and hard refresh.
(Assuming your using chrome)
If that's the issue and you don't want to deal with it again, then you could consider appending a cachebuster to your css url.
The easiest way to do that would be something like
{{site.theme.link}}/styles.css?r={{ random(1, 1000) }}
Keep in mind that in production, that's going to slow down delivery though (just a little bit, css files usually aren't that large) because it's going to invalidate the browser cache each time the site loads.

CSS not updating on change

When I try and change my current CSS or add new CSS to my style-sheet no change shows up (tags are still being styled by the old unchanged code).
For example, if I delete the contents of a class and I go into chrome debug tool using F12, I can see that the contents which I deleted are still showing up - even if I clear the cache by pressing Ctrl+Shift+R, OR by pressing Ctrl+F5!
All the other files of my website seem to be updating correctly, so if I use inline styles it will update correctly.
Strangely when I go into my websites control panel and manually download the CSS style-sheet from my server I can see that the code has indeed being updated with the new code, this is weird because upon inspecting it with F12, I can still see the old code with no changes.
I am using Microsoft Webmatrix to do my coding.
I am using the Chrome Web browser.
I am using Hostgator hosting.
I've exhausted all my trouble shooting options and have been beat by something that by all means should not occur. I think I've had a problem like this before and I think that it was solved by just waiting a day for whatever magic to work but I shouldn't have to wait. A problem like this is absolutely unacceptable in a live environment. Any ideas of what could be causing this?
FIXED!
changed: https://example.com/app/source/css/main.css
to this: https://example.com/app/source/css/main.css?v=1
You could try ctrl + shift + r (on a PC) to hard reset the browser and make sure the cache isn't displaying old CSS.
One thing is to verify you are editing the correct file. I managed to have that issue one time when I had two files named the same, but one was outside the folder with the index.html and that was the one I was editing.
Add ?v=1 behind the URL of the CSS link in the head, which will force using a non-cached version, because of the different (new) file name. The number should be unique, so if you want to use this in the future, make sure to replace the 1.

CSS - why my browsers can't reflect any changes made on the server?

I was working on some CSS code and then suddenly the server stopped reflecting any changed made on the server. At first I thought it was a caching problem but I disabled caching on my browser and even tried using different browsers but still it's using the old version of my CSS file.
If I download my CSS file from the server and open in the text editor, it shows all the changes I made to the code but they don't reflect on my website at all. The site is using old version of the CSS file that doesn't even exist anymore on the server.
What on Earth is happening with my server? Can it be a router caching problem?
I can't answer this but try to add in your html, where you include the css this: ?v1.
Example: src="resources/yourDir/style.css?v1"
This will force everything to download the new css.
You can add after the ? everything you want. Like a timestamp, just a number or words. Whatever you like.

CSS never loads. Impossible to edit my site. Cache?

Someone please explain this to me. I'm going crazy. I have a wordpress site and i can never make changes and simply see them in a browser.
So i get that i have to clear all caches etc etc etc. I do so and here are the scenarios:
a) i have w3 cache installed and then my website loads with no css.
b) i disable w3 cache but my website shows up with old css changes. I've added a whole bunch of .xxxxxxx { padding-right: xxpx;} things and they don't appear. But it is only the current changes that i'm in putting that are not showing up. i have a whole bunch of edits taht are showing up. So it must be some kind of cache!!!!##!##!##
I'm going nuts here. About to throw my computer out the window. Is there a way to just disable all caching or something of this nature until i'm done editing the website.
nhchat.com
I think your theme doesn't have support for w3 total cache. Just go into minification and select minification only (dont use "combine"). If the theme isn't built properly then it overrides the order that the files are loaded in. Secondly make sure that you edit the actual files (that are inside your theme directory) and not the cached ones.
Another thing to look into is the file permissions, right now the files cannot be accessed on your server. So make sure when you goto the address of your cached files, you should see a minified version of the files (right click > view source)
http://nhchat.com/wp-content/cache/minify/000000/dZFNjsIwDIUvRAisuMTsOEBkHNPxTH6q2FD19uO2g0pVsYvf--xnOWffCJIjUVByiUW5dG7SdCzghj55ECEVjyL-3mpRKvFw9l8wUrsmjtT81Mw4E2mSZZYNQsMB1d1ry-7iuWB6RFpmiY6J5HDyt8axo6VeyznO2h0MJDXvhWPmssUpUQcGsMX-z99DS-w3ke69DBhWf-sNdPtl_WjPeoh2s8y4tRpJbwvx89M2r7awkna7HwlYc1_FDvz2BW_ydhQ-RGsO9vwD.css

My CSS file is not saving

I'm working on a web page project, with an HTML file and a CSS file only. I use Sublime Text 3 for a better programming environment, I also use XAMPP to debug my code and test it on Chrome.
When I'm saving my programming files, the HTML one is saving, but CSS one is not saving; I checked it in the directory and opened it to view if my editions are saved or no, they are, but they don't show up in the debug using XAMPP and Chrome.
Why aren't my changes showing up in debug?
Try deleting the Chrome Browser's Cache. It might be creating that problem
It doesn't let me comment, but this is adding onto the users answer of clearing the browser cache.
Clear browser cache in chrome: https://support.google.com/accounts/answer/32050?hl=en&co=GENIE.Platform%3DDesktop
If the issue resolves after clearing your browsing cache, what I usually do when working with stylesheets is use the Chrome browser in incognito mode, it usually doesn't store cache in that mode, so after closing the tab and revisiting, it should show all of the changes.
fisrt try to clear/delete your browsers cache and if that didnt work try the steps below.
Lets say all your css code is in a file called style.css, what you need to do is:
you can just change the name of your file to something else for example style2.css (dont forget to also change the name in html file)
or
create a new file for example new-style.css.
copy and paste all the css code that you have from style.css to
new-style.css.
and lastly just delete style.css.
after that you can rename new-style.css back to style.css Or you can
keep it like that. doesnt really matter as long as you remember to
change the link name in html as well.
It might not be the best way to solve this problem but it works.