gpt4 book ai didi

html - 如何在 Flask 中使引导轮播标题响应

转载 作者:太空宇宙 更新时间:2023-11-04 05:39:49 25 4
gpt4 key购买 nike

我将引导轮播标题一直移动到左端,顶部和底部为零。但现在当我减小屏幕尺寸时,我的字幕失去了响应行为。当我缩小屏幕时,标题从轮播 slider 中消失,只剩下图像。如何使标题具有响应性?

HTML代码如下


<div class="container blog">
<!-- Carosal slider -->
<div id="carousel" class="carousel slide" data-ride="carousel" data-interval="3000">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carousel" data-slide-to="1"></li>
<li data-target="#carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<a href="/blog-page/{{ first.id }}" class="blog-link">
<img class="d-block w-100" src="{{ url_for('static', filename = 'uploads/blog/' + first['cover_img'])}}" alt="First slide" height="500px">
<div class="carousel-caption d-none d-md-block">
<div class="caption">
<h1>{{ first.title }}</h1>
<hr>
<p>{{ first.content[0:100] | safe }}...</p>
</div>
</div>
</a>
</div>
{% for blog in recent %}
<div class="carousel-item">
<a href="/blog-page/{{ blog.id }}" class="blog-link">
<img class="d-block w-100" src="{{ url_for('static', filename = 'uploads/blog/' + blog['cover_img'])}}" alt="First slide" height="500px">
<div class="carousel-caption d-none d-md-block">
<div class="caption">
<h1>{{ blog.title }}</h1>
<hr>
<p>{{ blog.content[0:100] | safe }}...</p>
</div>
</div>
</a>
</div>
{% endfor %}
</div>
<a class="carousel-control-prev" href="#carousel" 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="#carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>

这是CSS文件

 .carousel-caption {
background-color: white;
opacity: 0.9;
right: 0;
text-align: right;
height: 100%;
max-height: 100%;
max-width: 30%;
left: auto;
color: black;
padding: 2rem;
bottom: 0;
}

最佳答案

问题出在.d-none在这条线上 <div class="carousel-caption d-none d-md-block">

由于此类,这将它隐藏在除中型设备之外的所有设备上 d-md-block .因此,只需删除该类并设置好即可。

引用表格Bootstrap官网 Hiding elements

关于html - 如何在 Flask 中使引导轮播标题响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59317440/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com