該網頁顯示的路徑沒有 CSS:“/articles/int:article_id/”和“/articles/int:article_id/update”。對于所有其他頁面,CSS 正在加載。感謝您的幫助@app.route('/articles/<int:article_id>/')@login_requireddef 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 %}布局.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 回答

慕無忌1623718
TA貢獻1744條經驗 獲得超4個贊
我認為您需要按以下方式更改鏈接標簽。例如:
<link href="{{ url_for('static', filename='css/default.css') }}" rel="stylesheet" type="text/css" media="all" />
- 1 回答
- 0 關注
- 128 瀏覽
添加回答
舉報
0/150
提交
取消