Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How do I get an image to fit the bootstrap carousel, and also be responsive?

i am using the twitter bootstrap carousel to scroll through three images. The only problem is that I cannot get the images to fill the corresponding divs that they sit within. Any ideas?

<div id="myCarousel" class="carousel slide jumbotron" data-ride="carousel" data-interval="4000"> <div class="container-fluid"> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> </ol>

  <div class="carousel-inner">

    <div class="item active">      
        <img src="images/product_1.jpg" alt="First Product">                        
    </div>

    <div class="item">
      <img src="images/product_2.jpg" alt="Second Product">
    </div>

    <div class="item">
      <img src="images/product_3.jpg" alt="Third Product">
    </div>              

  </div>
</div>
  <a class="left carousel-control" href="#myCarousel" data-slide="prev">
    <span class="icon-prev"> </span>
  </a>
  <a class="right carousel-control" href="#myCarousel" data-slide="next">
    <span class="icon-next"> </span>
  </a>

</div>

1 Answer

This doesn't help me solve my problem does it?