"Carousel with text and box"
Bootstrap 4.1.1 Snippet by ReinierB78

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://demo.seothemes.com/business-pro/wp-content/uploads/2017/08/design-620x380.jpeg" alt="Los Angeles" style="width:100%;">
</div>
<div class="item">
<img src="https://demo.seothemes.com/business-pro/wp-content/uploads/2017/08/design-620x380.jpeg" alt="Chicago" style="width:100%;">
</div>
<div class="item">
<img src="https://demo.seothemes.com/business-pro/wp-content/uploads/2017/08/design-620x380.jpeg" alt="New york" style="width:100%;">
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
* {
position: relative;
box-sizing: border-box;
}
.text-box {
position: absolute;
width: 600px;
height: 300px;
background: #aaf;
top: 50%;
transform: translateY(-50%);
}
#myCarousel-2 {
position: absolute;
width: 600px;
top: 50%;
left: 60px;
transform: translateY(-50%);
color: #fff;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$(document).ready(function(){
$('.carousel').carousel({
"pause": "false"
});
$('.carousel-text').carousel({
"pause": "false"
});
})
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: