首页 > 解决方案 > 无法使用 FLASK 附加包含动画的 css 文件

问题描述

这是html文件

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>Covid-19 News Detection</title>

<!-- CSS  -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">


<link rel="stylesheet" type="text/css" href="{{url_for('static',filename='css/style.css')}}">
<link rel="stylesheet" type="text/css" href=" 
{{url_for('static',filename='css/materialize.css')}}">
</head>

这是路线

@app.route('/')
@app.route('/home')
def home():
   return render_template('home.html')

当我运行 ip 时,即使只是将 html 作为静态 chrome 文件“.html”打开时也没有任何变化,我看到了动画

标签: pythonhtmlcssflask

解决方案


推荐阅读