Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adjust Bootstrap carousel to full height

How do I set the height of Carousel to Full, I want it to occupy the screen when the user opens the page and the behavior is the same for mobile.

When accessing the site, the carusel must occupy the entire viewing area, it should not be possible to visualize the text "Our Services", without scrolling Scrool.

<div id="myCarousel" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
    <ol class="carousel-indicators">
      <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
      <li data-target="#myCarousel" data-slide-to="1"></li>
      <li data-target="#myCarousel" data-slide-to="2"></li>
      <li data-target="#myCarousel" data-slide-to="3"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">

      <div class="item active">
        <img src="img\portfolio\concretobombeado.jpg" alt="Chania" width="460" height="345">
        <div class="carousel-caption">
          <h3>Chania</h3>
          <p>The atmosphere in Chania has a touch of Florence and Venice.</p>
        </div>
      </div>

      <div class="item">
        <img src="img\portfolio\limpeza.jpg" alt="Chania" width="460" height="345">
        <div class="carousel-caption">
          <h3>Chania</h3>
          <p>The atmosphere in Chania has a touch of Florence and Venice.</p>
        </div>
      </div>

      <div class="item">
        <img src="img\portfolio\limpeza.jpg"alt="Flower" width="460" height="345">
        <div class="carousel-caption">
          <h3>Flowers</h3>
          <p>Beatiful flowers in Kolymbari, Crete.</p>
        </div>
      </div>

      <div class="item">
        <img src="img\portfolio\limpeza.jpg" alt="Flower" width="460" height="345">
        <div class="carousel-caption">
          <h3>Flowers</h3>
          <p>Beatiful flowers in Kolymbari, Crete.</p>
        </div>
      </div>

    </div>

    <!-- Left and right controls -->
    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
      <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
      <span class="sr-only">Next</span>
    </a>
  </div>

image

like image 823
Paulo Roberto Avatar asked Apr 30 '26 09:04

Paulo Roberto


1 Answers

you could add this to your css file.

 #myCarousel{
 height:100vh;
 width:100%;
 }

100vh would set the height of your carousal to 100% of the devices' screen height.

This would set the height and width of your carousal to occupy the entire screen.

After this you might also need to modify the .carousel-inner class' height to 100%. then you can accordingly adjust your images' width.

like image 155
lhavCoder Avatar answered May 01 '26 22:05

lhavCoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!