I want to change my background site so at first it changed but when I trying to change it again to another color it not happen I link my code file with style.css file with this code
{% load static %}
style.css (code):in my style.css folder
body{
background-color: blue;}
first I changed the background to brown then I want to change it to blue but it doesn't change
(also when I go to my site it still brown also when I use this code in style.css (body{ background-color: blue} when I click on inspect it appears to me body{ background-color: brown} )
CodePudding user response:
Try renaming the CSS file if ctrl f5 does not solve it.
CodePudding user response:
Maybe this is a technical problem with Django as that CSS code would normally work for me in VS Code.
Try writing that CSS code in the HTML file in a Style tag, although I'm not sure if that'll work for files committed into HTML.
CodePudding user response:
You have to add templates in your
setting.py
as well asSTATIC_URL = '/static/'
then you have to restart your server with this command.You have to add CSS file in your static folder and that folder in your project then it will work.
See more at https://docs.djangoproject.com/en/3.2/howto/static-files