0

I have a CSS file in which i added a background initially to it. Then after some time i added some more background images to my media folder and tried to change the background. But this time, it didn't work. And moreover, the previous background image itself is loaded again. I tried to inspect the webpage. There, in sources, I opened the CSS file. It was not updated. It is still showing the previous background image url. How to rectify this issue?

My CSS file(previously):

    body {
    background: white url("images/background.png");
}

ul.errorlist {
    padding-left: 0;
}

ul.errorlist > li {
    list-style: none;
}

.navbar {
    border-radius: 0;
}

.navbar-brand {
    font-family: 'Satisfy', cursive;
}

Then I changed the background image url to:

body {
background: white url("images/ak.jpg");
}

The new image is not loading. When I inspect the element, the previous CSS file is shown.

2
  • Did you delete your browser cache? Commented Jan 21, 2018 at 10:18
  • Yeah it is working now. But everytime I change the background image, I have to clear cache. Is there any other way to rectify it? Commented Jan 21, 2018 at 10:22

1 Answer 1

1

As mentioned in the comments you have to clear your cache. You can do that faster by hitting: Windows: ctrl + F5 Mac/Apple: Apple + R or command + R Linux: F5

Alternatively you can disable your cache on Chrome/Firefox while DevTools are open by opening DevTools (ctrl + shift + I), going to the options tab (F1) and ticking the box Disable cache(while DevTools is open). This will ensure that the browser never cashes your files as long as you have DevTool open.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.