【发布时间】:2021-07-09 16:55:19
【问题描述】:
附加到我的 python 代码的 CSS 文件不起作用,我似乎无法弄清楚原因,因为没有错误,而且我尝试了多种方法。
结构:
app{
|app
|templates
|public
|index.html
|env
|static
|css
|styles.css
我已将它附加到 index.html
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
在我使用的python文件中
@app.route("/")
def index():
return render_template("public/index.html")
一切正常,但 CSS 在页面上不起作用: style.css
body {
color: red;
}
【问题讨论】:
标签: python html css python-3.x flask