Bootstrap 3旋转木马指示器,字形和字幕不会停留在旋转木马区域的顶部

时间:2014-05-09 15:00:49

标签: html css twitter-bootstrap-3

我的引导程序carousel无法正常工作。当我以更大的分辨率查看时,三个营销信息会移动到我的carousel图像之上。当我移动到较小的屏幕尺寸时,我的旋转木马指示器,左右gliphicons和标题太低。他们不会停留在旋转木马顶部或旋转木马上。我也试图删除屏幕两侧的灰色gradient。如果你不能说我是网络开发的新手:/

HTML:

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

    <div class="carousel-inner">
        <div class="item active">
            <img src="img/dx1slider.png" class="img-responsive" alt="responsive image">
            <div class="container">
                <!--
                <div class="carousel-caption">
                    <h1>Equipment Web Services.</h1>
                    <p>a SOLUTION for your online marketing needs.</p>
                    <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn More</a></p>
                </div>
                -->
            </div>
        </div>
        <div class="item">
            <img src="img/revolutionizing.png" class="img-responsive" alt="img description">
            <div class="container">

                <div class="carousel-caption">
                    <h1>caption</h1>
                    <p>more caption</p>
                    <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
                </div>

            </div>
        </div>
        <!--
        <div class="item">
            <img src="img/carousel-3-1024x683.jpg" alt="Third slide">
            <div class="container">
                <div class="carousel-caption">
                    <h1>BidTrader</h1>
                    <p>The Most Trusted Place to Sell Your Used Units Every Month.</p>
                    <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn More.</a></p>
                </div>               
            </div>
        </div>
        -->
    </div>

    <a class="left carousel-control" href="#myCarousel" slide="prev"><span class="glyphicon  glyphicon-chevron-left"></span></a>
    <a class="right carousel-control" href="#myCarousel" slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
</div><!-- /.carousel -->

我的css:

 /* Carousel base class */
.carousel {
    height: 400px;
    margin-bottom: 60px;
    margin-top: 150px;
}

/* Since positioning the image, we need to help out the caption */
.carousel-caption {
    z-index: 10;
}

/* Declare heights because of positioning of img element */
.carousel .item {
    height: 600px; 
    background-color: #fff;
}

.carousel-inner > .item > img {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 100%;
    margin-top: 10px;
 /* height: 400px; I removed this and added margin-top:10px; to make carousel responsive*/
}

/* moves my indicators to the right */
.carousel-indicators {
    margin-left: 60px;
}

.carousel-inner {
    margin-bottom:50px;
}

0 个答案:

没有答案