简体   繁体   English

CSS 文件未设置文本样式

[英]CSS File not styling the text

I have been recently developing a website on Django and would like to use CSS for some basic stuff.我最近一直在开发一个关于 Django 的网站,并且想使用 CSS 来做一些基本的事情。 As a test, i made a static dir, and all.作为测试,我做了一个 static 目录,等等。 And applied my css like this h1 { color:blue } .并像这样应用我的 css h1 { color:blue } This works, but when i want to change the color to something like red, and I refresh the page, it doesnt work at all (It stays Blue).这可行,但是当我想将颜色更改为红色时,我刷新页面,它根本不起作用(它保持蓝色)。 Any ideas on how to fix this?有想法该怎么解决这个吗? I loaded static like this on the HTML我在 HTML 上像这样加载了 static

<link rel="stylesheet" type="text/css" href="{% static 'WEBApp/style.css' %}">

Replace {% static 'WEBApp/style.css' %} with the CSS file name, or, if it is in a different folder, do the entire file address.{% static 'WEBApp/style.css' %}替换为 CSS 文件名,或者,如果它位于不同的文件夹中,则使用整个文件地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM