我在问这个问题,希望这次能更好地提出。我的主页(相册模板)上的bootstrap 4导航栏没有单击打开和dsiplay链接。这是当我尝试在django中加载此页面时发生的情况的图片。这三行不能单击和打开。
我已经正确上传了boostrap album.min.css,页面加载并且看起来像原始专辑示例一样。我还上传了此页面的样式表。它看起来与专辑示例完全相同,只是无法单击导航栏链接。其他一切正常。我的静态文件加载。
这是html文件。
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Album example for Bootstrap</title>
<link href="{% static 'css/album.min.css' %}" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="{% static 'css/album.css' %}" rel="stylesheet">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins)-->
<script href="{% static 'js/jquery.js' %}" ></script> <!--jquery-->
<!-- <script href = "{% static 'js/collapse.js' %}"></script>
<script href = "{% static 'js/dropdown.js' %}"></script> -->
</head>
<body>
<div class="collapse bg-inverse" id="navbarHeader">
<div class="container">
<div class="row">
<div class="col-sm-8 py-4">
<h4 class="text-white">
<li><a href="{% url 'about' %}">About</a></li>
</h4>
<p class="text-muted">About us.</p>
</div>
<div class="col-sm-4 py-4">
<h4 class="text-white">Contact</h4>
<ul class="list-unstyled">
<li><a href="{% url 'contact' %}" class="text-white">Contact us</a></li>
<li><a href="#" class="text-white">Like on Facebook</a></li>
<li><a href="#" class="text-white">Follow on Twitter</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="navbar navbar-inverse bg-inverse">
<div class="container d-flex justify-content-between">
<a href="#" class="navbar-brand">MedTrend</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
这是我与此相关的设置文件。
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(os.path.abspath(os.path.dirname(__file__)), "static",),
)