我正在建立一个网站,我正在使用Bootstrap作为页面顶部的滑块。唯一的问题是,在完成转换后,图像会向上移动约100px并使整个网站看起来很糟糕。您可以在此处查看我的代码笔http://codepen.io/anon/pen/JYYgOj
<header id="headerCarousel" class="carousel slide" date-ride="carousel" data-interval="300000000">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active" style="background:url(https://wallpaperscraft.com/image/keyboard_apple_black_white_backlit_31066_3840x2400.jpg) center center fixed; background-size:cover; background-position: 0 0;">
TEXT
</div>
<div class="item" style="background:url(http://itop.freewallpaper-s.net/wp-content/uploads/wallpapers/Home-office-macbookair-apple-brand-notebook-computer-top-uhd-4k-wallpapers-2560x1440.jpg) center center fixed; background-size:cover; background-position: 0 0;">
TEXT
</div>
</div>
<a class="left carousel-control" href="#headerCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#headerCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</header>