0
我是Flask和Bootstrap的新手,嘗試將它們一起使用,但是在呈現html時,引導程序的樣式不適用,這只是簡單的。具體來說,我從bootstrap組件頁獲得的「<div class="nav nav-tabs nav-justified">
」沒有得到應用。有人可以告訴我爲什麼?我現在正在本地開發。在此之前我使用的CSS文件可以正常工作。 在此先感謝。 我的代碼:爲什麼我的引導樣式沒有得到應用?
<!doctype html>
<title>My Page</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<div class=page>
<h1>My Page</h1>
<div class="nav nav-tabs nav-justified">
<a href="{{ url_for('main_page') }} ">home</a>
{% if not session.logged_in %}
<a href="{{ url_for('login') }}">log in</a>
{% else %}
<a href="{{ url_for('logout') }}">log out</a>
<a href="{{ url_for('reminders') }}">reminders</a>
{% endif %}
<a href="{{ url_for('about') }}">about</a>
</div>
{% for message in get_flashed_messages() %}
<div class=flash>{{ message }}</div>
{% endfor %}
{% block body %}{% endblock %}
</div>
先添加適當的標記。像'
..',並把'link href ='''放在'head tag'裏面。在你的引導樣式表中加入'type ='text/css''。 – CodeRomeos您需要'
...'標籤。 – Adi