html - 向 Bootstrap Carousel 添加顶层

标签 html css twitter-bootstrap carousel layer

我正在使用最新的 Bootstrap V 3.3.2,基本上我正在尝试创建一个旋转木马(我已经完成了),但我想添加一个顶层,该顶层有一个带有设计的切口。我想让背景中的图片相对快速地移动,只能通过切口看到。我怎样才能做到这一点?

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>title</title>

<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!--Custom CSS -->
<link href="css/custom.css" rel="stylesheet">

</head>

<body>

<!-- Full Page Image Background Carousel Header -->
<header id="myCarousel" class="carousel">

    <!-- Wrapper for Slides -->
    <div class="carousel-inner">
        <div class="item active">
            <!-- Set the first background image using inline CSS below. -->
            <div class="fill" style="background-image:url('http://placehold.it/1900x1080&text=Slide One');"></div>
        </div>
        <div class="item">
            <!-- Set the second background image using inline CSS below. -->
            <div class="fill" style="background-image:url('http://placehold.it/1900x1080&text=Slide Two');"></div>
        </div>
        <div class="item">
            <!-- Set the third background image using inline CSS below. -->
            <div class="fill" style="background-image:url('http://placehold.it/1900x1080&text=Slide Three');"></div>
        </div>
    </div>

</header>


<!-- Bootstrap Core Javascript -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/bootstrap.min.js"></script>


<!-- Carousel -->
<script>
$('.carousel').carousel({
    interval: 500 //changes the speed
})
</script>

</body>

</html>


html,
body {
height: 100%;
}

/*========================================
carousel
========================================*/
.carousel,
.item,
.active {
height: 100%;
}

.carousel-inner {
height: 100%;
}

/* Background images are set within the HTML using inline CSS, not here */

.fill {
width: 100%;
height: 100%;
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}

最佳答案

好的。这是概念:尝试使用 style background-size: cover;

事实上,如果我站在我面前这样的问题 - 我已经创建了几个 block ,其中一个部分是为了隐藏轮播 - 设置为他的 background-size: cover 并移动在前面抛出 index-z .

关于html - 向 Bootstrap Carousel 添加顶层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28529483/

相关文章:

javascript - 如何从嵌入标签访问#document 的 dom 元素?

javascript - 为 iFrame 创建放大和缩小功能

html - 在页脚的一行中显示 5 列 - Bootstrap

html - 当子链接处于事件状态时使父链接处于事件状态

twitter-bootstrap - 如何以正确的方式在 angular.js 中实现 scrollspy?

jquery - 在Bootstrap模式下停止一些YouTube视频的灵活方法

javascript - 如何使用 jquery 使用垂直文本和内容切换垂直选项卡

javascript - 多步骤表单 "next"按钮不起作用

javascript - 在 foreach 循环中为每个具有 ID 的元素添加类

html - 调整窗口大小时页脚内容被推送