网页显示的路径'/ articles / <int:article_id> /'(烧瓶)没有CSS,

时间:2020-04-04 13:15:21

标签: html css flask

该网页显示的路径没有CSS:“ / articles / int:article_id /”和“ / articles / int:article_id / update”。 对于所有其他页面,正在加载CSS。谢谢您的帮助

@app.route('/articles/<int:article_id>/')
@login_required
def article(article_id):
    article = Article.query.get_or_404(article_id)
    return render_template('article.html', title='Artikel', article=article)


---------------------------------------------------------------------------------------------------------

{% extends 'layout.html' %}
{% block content %}

(...)

{% endblock content %}

Layout.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href='http://fonts.googleapis.com/css?family=Pontano+Sans' rel='stylesheet' type='text/css' />
<link href="../static/css/default.css" rel="stylesheet" type="text/css" media="all" />
<link href="fonts.css" rel="stylesheet" type="text/css" media="all" />

<!--[if IE 6]><link href="default_ie6.css" rel="stylesheet" type="text/css" /><![endif]-->

</head>
<body>
<div id="header-wrapper">
    <div id="header" class="container">
        <div id="menu">
            <ul>
                <li class="current_page_item"><a href="{{ url_for('home') }}" accesskey="1" title="">Home</a></li>
                <li><a href="{{ url_for('new_article') }}" accesskey="2" title="">Tracken</a></li>
                <li><a href="{{ url_for('articles') }}" accesskey="3" title="">Artikel</a></li>
                <li><a href="#" accesskey="4" title="">Profil</a></li>
                <li><a href="{{ url_for('logout') }}" accesskey="5" title="">Logout</a></li>
            </ul>
        </div>
    </div>
</div>
{% block content %} {% endblock %}

1 个答案:

答案 0 :(得分:0)

我认为您需要通过以下方式更改链接标签。例如:

<link href="{{ url_for('static', filename='css/default.css') }}" rel="stylesheet" type="text/css" media="all" />
相关问题