7

特定の Web サイト用に作成したカルーセルに問題があります。カルーセルは、Mozilla firefox バージョン 25.0 を除いて、私がテストしたすべてのブラウザーで動作する必要があります。ここに画像の説明を入力

誰かが同様の問題を経験したことがある場合は、どのように解決したかを知りたいです。ありがとう、カルーセルのコードは次のとおりです

<!-- Carousel================================================== -->
<div id="Carousel" class="carousel slide">
<!-- Indicators -->
<ol class="carousel-indicators">
  <li data-target="#Carousel" data-slide-to="0" class="active"></li>
  <li data-target="#Carousel" data-slide-to="1"></li>
  <li data-target="#Carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
  <div class="item active">
    <img src="images/slide_pics/1.png" alt="First slide">
    <div class="container">
      <div class="carousel-caption">
        <h1>Example headline.</h1>
        <p>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>
        <p><a class="btn btn-large btn-primary" href="#">Sign up today</a></p>
      </div>
    </div>
  </div>
  <div class="item">
    <img src="images/slide_pics/2.jpg"  alt="Second slide">
    <div class="container">
      <div class="carousel-caption">
        <h1>Another example headline.</h1>
        <p>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>
        <p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
      </div>
    </div>
  </div>
  <div class="item">
    <img src="images/slide_pics/3.jpg" alt="Third slide">
    <div class="container">
      <div class="carousel-caption">
        <h1>One more for good measure.</h1>
        <p>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>
        <p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
      </div>
    </div>
  </div>
</div>
<a class="left carousel-control" href="#Carousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="right carousel-control" href="#Carousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>

これが私が使用しているcssです

/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */

body {
padding-bottom: 40px;
color: #5a5a5a;
}



/* CUSTOMIZE THE NAVBAR
-------------------------------------------------- */

/* Special class on .container surrounding .navbar, used for positioning it into place. */
.navbar-wrapper {
position: relative;
z-index: 15;
}


/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */

/* Carousel base class */
.carousel {
margin-bottom: 0px;

/* Negative margin to pull up carousel. 90px is roughly margins and height of navbar. */
margin-top: 0px;
}
/* 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: 400px;
margin-top:-10px;
background-color: #ccc;
}
.carousel-inner > .item > img {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
height: 400px;
}
4

5 に答える 5

8

Not necessarily an answer here, more of a debugging hint... but when I'm faced with issues like this I add a 1px border to each item after your current css, but in a different colour i.e.

.navbar-wrapper {1px solid purple;}
.carousel {border: 1px solid black;}
.carousel-caption {border: 1px solid yellow;}
.carousel .item {border: 1px solid blue;}
.carousel-inner > .item > img {border: 1px solid red;}

Once thats done you'll see who the 'culprit' is - you'll most likely have to specify margin-left: 0px; for that element, as it seems like Firefox is inheriting the margin from a parent element in error. Then just take out the crazy borders!

于 2013-10-18T09:28:22.407 に答える
4

私は同じ問題を抱えていました。問題はカルーセルにあることがわかりました。

.carousel { border: 1px solid black; }

問題を修正しました。

Firefox 20 (Mac) ブートストラップ 3.1.1

于 2014-03-12T04:51:52.737 に答える
2

私はそれだけで解決しました:

.carousel {
  border-top: 1px solid #000
}
于 2014-10-18T14:32:04.437 に答える
1
.carousel {
  border-top: 1px solid transparent;
}
于 2015-10-06T20:12:01.577 に答える
0
body {
    overflow-x: hidden;
}
于 2016-01-04T06:18:44.287 に答える