html – I need to make the text in carousel to be responsive-ThrowExceptions

Exception or error:

I have used bootstrap 4 classes and media queries but the text disappears when I look up the site on phone.`

—–any text ——-
—–any text ——-
—any text—

        </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;}
How to solve:

Check CSS in Media script for classes of your text, might be display property set to none. either these classes “n26 animated bounceInRight display-2” or these “animated bounceInLeft”.

###

i made this and responsive. please check it. Thanks

@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"/>

Leave a Reply

Your email address will not be published. Required fields are marked *