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 Framework Basics Prototyping with Bootstrap Building a Carousel

Waqar Ashraf
Waqar Ashraf
3,743 Points

Carousel pushing down the body

<div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>

    </button>
    <a href="#" class="navbar-brand text-muted"> Ribbit</a>
    <div class="navbar-collapse collapse" >
        <ul class="nav navbar-nav navbar-right ">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#">About Ribbit</a></li>
            <li class="dropdown " ><a data-toggle="dropdown"  data-target="#">Treehouse <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="#">About Treehouse</a></li>
                    <li><a href="#">Video Library</a></li>
                    <li><a href="#">Learning Adventures</a></li>
                    <li class="divider"></li>
                    <li><a href="#">Prices &amp; Pricing  </a></li>
                </ul>
            </li>

        </ul>

    </div>
    <div>

    </div>




</div>

</div> <div id="myCarousel" class="carousel slide jumbotron " > <div class="container"> <div class="carousel-inner "> <div class="item active">

        <h1>Self-destructing message app</h1>
        <p class="lead">Learn how to build this fun little app by signing up for a Treehouse account today! We'll teach you how to build both apps from scratch!</p>
        <p class="btn-group">
            <a class="btn btn-success btn-lg" href="#">Download the app</a>
            <a class="btn btn-default btn-lg" href="#" >Text me the link</a>
        </p>
        </div>
    <div class="item">
        <h1>Learn how to build it for iOS</h1>
        <p class="lead">We'll teach you how to build it from scratch!</p>
        <p>
            <a class="btn btn-success btn-lg" href="#">Get started today!</a>
        </p>


    </div>
    <div class="item">
        <h1>Learn how to build it for Android</h1>
        <p class="lead">We'll teach you how to build it from scratch!</p>
        <p>
            <a class="btn btn-success btn-lg" href="#">Get started today!</a>
        </p>

    </div>




</div>



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


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


    </span>
</a>

</div>

<div class="container">

<div class="row">
    <div class="col-sm-4">
        <b class="glyphicon glyphicon-camera" ></b>

        <h2>Delete photo &amp; video based on a timer</h2>
        <p>Learn how to write the code that downloads and displays messages, photos, and videos that timeout after a few seconds. Then create the code that deletes them from the back-end to make them "self destruct."</p>
    </div>

    <div class="col-sm-4">
        <b class="glyphicon glyphicon-user"></b>

        <h2>Build an easily managed friends list</h2>
        <p>Learn what Parse.com offers as a "backend-as-a-service" platform. Explore the user account management APIs provided by Parse.com and write the code to create and save a new user in a Parse.com data store.</p>
    </div>

When i am sliding my carousel the slide which is little bigger why it pushing down the body and how i can prevent it ?

1 Answer

Matt Kelm
Matt Kelm
7,240 Points

Hi Waqar,

The amount of content in each item determines how tall the slider is, so a slide with much more content will push the rest of the page down when it comes around. An alternative (though maybe not a best practice for mobile, etc) is to give the slider a specific height, such as 350px.