css is not working after uploading the file on server with filezilla or cpanel
Asked Answered
A

7

7

I have uploaded the file.css file on server with filezilla and also with cpanel. But when i browse the website the css has no impact.

I changed: padding-left: 10px; If i see the Page view source i see that the older file is there.

What can be the reason for that ?

Applewhite answered 19/9, 2011 at 15:41 Comment(0)
R
22

Try doing a hard refresh. CTRL Shift R. That should force any cached files to clear. Chances are that's the problem, unless the file isn't uploading. If you see the new file listed in Filezilla then it's a cache issue.

Romie answered 19/9, 2011 at 15:49 Comment(2)
How can I do a hard refresh only for the file? I don't want to clear all the cached files, but only the the file that I am uploading. Any idea?Larochelle
Thanks so much I can't believe I never knew this before, solves a lot of my problemsSaransk
C
4

Have you checked the permission for css files?

It should be 644 for all files, and 755 for all folders.

Caliche answered 26/7, 2015 at 12:10 Comment(1)
hey there. Some day you will have enough reputation to comment, and that will be great, but for now refrain from posting such answers which are not really answers: you are asking op about clarifications.Stichous
S
3

Did you replace/overwrite the existing css file? It sounds like maybe the old one wasn't overwritten - in which case you'll have to do that for the changes to take effect.

Are you using a CMS? Some of them have Cache features where it may take time for those changes to be reflected unless you hard refresh.

Spirketing answered 19/9, 2011 at 15:47 Comment(0)
S
1

http://httpd.apache.org/docs/2.2/programs/htcacheclean.html

If you are using apache2 this is amazing, use the "-i" option, the reason the files dont update is because they are cached, if you cant do this you can always change the href="styles.css" into href="styles.css?v=version2" it makes the server think that there is a new file, so then it updates the cache

Snuffy answered 5/7, 2013 at 11:27 Comment(0)
K
1

First try to clear the cache. If nothing happens then link your CSS like this:

<link rel="stylesheet" type="text/css" href="style.css?v=0.001">

It should help.

Kapoor answered 13/5, 2015 at 10:47 Comment(0)
O
1

I changed the name of the .css file, deleted the old one from the server, reuploaded and directed the html to that newly named and uploaded css file. Worked like a charm for some reason.

Obligate answered 19/3, 2016 at 16:28 Comment(0)
D
1

If you are using nginx, you very likely have deleted the "include mime.types" directive from your nginx.conf file by mistake. So you should add it back(the code below was copied from Daniel Peterson):

http {
    include mime.types;
    ...

    server {
        listen: 80
        ...
    }

After editing the conf file and reload the nginx server, you may also want to clean the cache on your browser by pressing ctrl+f5.

Devi answered 30/1, 2023 at 18:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.