Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Positioning and styling of Twitter Bootstrap Carousel Image Captions

I am trying to change the position of Carousel in the Twitter Bootstrap site. What I am trying is to bring the caption in the middle of the image (Center aligned from top and left). It is right now aligned bottom.

The code is as follows:-

<div id="myCarousel" class="carousel slide">
    <div class="carousel-inner">
      <div class="item active" id="home-carousel-inner">
        <img src="media/39440/CHI-3-4-2048x1152-v31931.jpg" alt="">
         <div class="container">
          <div class="carousel-caption">
            <h1>Another dsdaf headline.</h1>
            <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
            <a class="btn btn-large btn-primary" href="#">Learn more</a>
          </div>
        </div>

      </div>
      <div class="item">
        <img src="media/39468/CIH-1-2048x1152-v31931.jpg" alt="">
        <div class="container">
          <div class="carousel-caption">
            <h1>Another example headline.</h1>
            <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
            <a class="btn btn-large btn-primary" href="#">Learn more</a>
          </div>
        </div>
      </div>
      <div class="item">
        <img src="media/32602/CIH-2-2048x1152-1931.jpg" alt="">
        <div class="container">
          <div class="carousel-caption">
            <h1>One more for good measure.</h1>
            <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
            <a class="btn btn-large btn-primary" href="#">Browse gallery</a>
          </div>
        </div>
      </div>
    </div>
    <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
    <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>

It'd be something like this ...

enter image description here

Right now, it looks like this:-

enter image description here

like image 380
Steve Avatar asked Jun 02 '13 21:06

Steve


1 Answers

You could customize the Bootstrap .carousel-caption CSS..

.carousel-caption {
      max-width: 550px;
      padding: 0 20px;
      margin:0 auto;
      margin-top: 200px;
      text-align:center;
}

Here is a Bootply to demonstrate

like image 97
Zim Avatar answered Oct 16 '22 11:10

Zim