我需要使旋转木马中的文本具有响应性



我使用了bootstrap 4类和媒体查询,但当我在电话上查找网站时,文本消失了。` -----任何文本------------任何文本----------任何文本---

</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src=" img2.png" alt="Second slide" style="height: auto">
<div class="carousel-caption d-none d-md-block n28">
<h1 class="n26 animated bounceInRight display-2" style="animation-delay: 0.5s">-----any text -------</h1>
<h3 class="animated bounceInLeft" style="animation-delay: 0.5s">-----any text -------</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="img3.png" alt="Third slide" style="height: auto">
<div class="carousel-caption d-none d-md-block n28">
<h1 class="n26 animated bounceInRight display-2" style="animation-delay: 0.5s">-----any text -------</h1>
<h3 class="animated bounceInLeft" style="animation-delay: 0.5s">-----any text -------</h3>
</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>

.carousel-caption{
position: absolute;
top: 30%;
transform: translateY(-50);}
.carousel-caption h1{
font-size: 500%;}
.carousel-caption h3{
font-size: 110%;
font-family: "Poppins", sans-serif;}

在Media脚本中检查CSS中的文本类,可能显示属性设置为none。这些类"n26 animated boundInRight display-2"或这些"animated bounceInLeft"。

我做到了,并做出了回应。请查收。谢谢

@media only screen and (max-width: 767px) {
.carousel-caption { display:none;}
}
<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">
<div class="carousel-item active">
<img class="d-block w-100" src="https://cruxnow.com/wp-content/uploads/2019/09/Natural-cemetery-Natuurbegraafplaats-Koningsakker-1024x576.jpg" alt="First slide">
<div class="carousel-caption d-md-block n28">
<h1 class="n26 animated bounceInRight display-2" style="animation-delay: 0.5s">-----any text -------</h1>
<h3 class="animated bounceInLeft" style="animation-delay: 0.5s">-----any text -------</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://cruxnow.com/wp-content/uploads/2019/09/Natural-cemetery-Natuurbegraafplaats-Koningsakker-1024x576.jpg" alt="Second slide">
<div class="carousel-caption d-md-block n28">
<h1 class="n26 animated bounceInRight display-2" style="animation-delay: 0.5s">-----any text -------</h1>
<h3 class="animated bounceInLeft" style="animation-delay: 0.5s">-----any text -------</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://cruxnow.com/wp-content/uploads/2019/09/Natural-cemetery-Natuurbegraafplaats-Koningsakker-1024x576.jpg" alt="Third slide">
<div class="carousel-caption d-md-block n28">
<h1 class="n26 animated bounceInRight display-2" style="animation-delay: 0.5s">-----any text -------</h1>
<h3 class="animated bounceInLeft" style="animation-delay: 0.5s">-----any text -------</h3>
</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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>

最新更新