Jquery 烧瓶罐';无法加载css文件

Jquery 烧瓶罐';无法加载css文件,jquery,python,html,css,flask,Jquery,Python,Html,Css,Flask,我对下面的模板有一个问题:CSS文件没有加载 我正确地将“style.css”放在“my_project/static/”中 我只是试着用“style.css”代码替换HTML文件源代码中的,效果很好 有什么问题 <!doctype html> <title>{% block title %}Welcome{% endblock %} | MiniTwit</title> <link rel=stylesheet type=text/css href="

我对下面的模板有一个问题:CSS文件没有加载

我正确地将“style.css”放在“my_project/static/”中

我只是试着用“style.css”代码替换HTML文件源代码中的
,效果很好

有什么问题

<!doctype html>
<title>{% block title %}Welcome{% endblock %} | MiniTwit</title>
<link rel=stylesheet type=text/css href="{{  url_for('static', filename='style.css') }}">

<div class=page>
  <h1>MiniTwit</h1>
  <div class=navigation>
  {% if g.user %}
    <a href="{{ url_for('timeline') }}">my timeline</a> |
    <a href="{{ url_for('public_timeline') }}">public timeline</a> |
    <a href="{{ url_for('logout') }}">sign out [{{ g.user.username }}]</a>
  {% else %}
<a href="{{ url_for('public_timeline') }}">public timeline</a> |
<a href="{{ url_for('register') }}">sign up</a> |
<a href="{{ url_for('login') }}">sign in</a>
  {% endif %}
  </div>
  {% with flashes = get_flashed_messages() %}
    {% if flashes %}
      <ul class=flashes>
      {% for message in flashes %}
        <li>{{ message }}
      {% endfor %}
      </ul>
    {% endif %}
  {% endwith %}
  <div class=body>
  {% block body %}{% endblock %}
  </div>
  <div class=footer>
    MiniTwit &mdash; A Flask Application
  </div>
</div>

{%block title%}欢迎{%endblock%}| MiniTwit
小人
{%if g.user%}
|
|
{%else%}
|
|
{%endif%}
{%with flash=get_flashed_messages()%}
{%if闪烁%}

{%用于Flash中的消息%}
  • {{message}} {%endfor%} {%endif%} {%endwith%} {%block body%}{%endblock%} MiniTwit&mdash;烧瓶应用
  • 您应该在
    链接
    标记中的属性值周围加上双引号,并将此标记放在
    标题
    标记中:

    <head>
    <title>{% block title %}Welcome{% endblock %} | MiniTwit</title>
    <link rel="stylesheet" type="text/css" href="{{  url_for('static', filename='style.css') }}">
    </head>
    
    
    {%block title%}欢迎{%endblock%}| MiniTwit
    

    并关闭html文件末尾的
    html
    标记。

    为什么在正文外有一个div?-这是python的东西吗?请发布一个应用程序文件夹结构和应用程序配置的最小示例。这闻起来像是Flask没有正确解析静态文件的路径。我已经这样做了,但它不起作用。我上面写的代码是一本关于使用Flask进行web编程的书中的示例代码。