Twitter bootstrap 引导转盘不适用于烧瓶布线
我在index.HTML中有以下HTML代码:Twitter bootstrap 引导转盘不适用于烧瓶布线,twitter-bootstrap,flask,Twitter Bootstrap,Flask,我在index.HTML中有以下HTML代码: {% block header %} <header> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-s
{% block header %}
<header>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<!-- Slide One - Set the background image for this slide in the line below -->
<div class="carousel-item active" style="background-image: url('http://placekitten.com/1900/1080')">
<div class="carousel-caption d-none d-md-block">
<h3>First Slide</h3>
<p>This is a description for the first slide.</p>
</div>
</div>
<!-- Slide Two - Set the background image for this slide in the line below -->
<div class="carousel-item" style="background-image: url('http://placekitten.com/1900/1080')">
<div class="carousel-caption d-none d-md-block">
<h3>Second Slide</h3>
<p>This is a description for the second slide.</p>
</div>
</div>
<!-- Slide Three - Set the background image for this slide in the line below -->
<div class="carousel-item" style="background-image: url('http://placekitten.com/1900/1080')">
<div class="carousel-caption d-none d-md-block">
<h3>Third Slide</h3>
<p>This is a description for the third slide.</p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</header>
{% endblock %}
问题是,当我单击转盘上的“下一步”按钮时,它将不起作用,并且显示的URL为:
http://127.0.0.1:5000/index#carouselExampleIndicators
我知道问题很明显,但我想不出解决办法。我试图保持index.html独立。。或者尝试将传送带id发送回路由器,然后从那里开始。。但我所有的尝试都是徒劳的。我使用引导4.1.3和flask 1.0.2。看起来index.html页面缺少指向引导的链接。您可以从中获取bootstrap.css和bootstrap.min.js,并将css和js文件夹保存在flask template文件夹(index.html所在的位置)中 在
{%block header%}
之后添加
,在{%endblock%}
之前添加
应该可以使旋转木马中的图像滑动正常工作
例如:
{%block header%}
.... 您的转盘HTML代码在这里。。。。
{%endblock%}
如果链接已经存在于扩展此文件的基础文件中,我不确定为什么块必须具有引导链接。你能告诉我更多关于它的情况吗?
http://127.0.0.1:5000/index#carouselExampleIndicators
{% block header %}
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<header>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
.... YOUR HTML CODE FOR CAROUSEL GOES HERE ....
</div>
</header>
<script src="js/bootstrap.min.js"></script>
{% endblock %}