"Sticky Sidebar"
Bootstrap 4.1.1 Snippet by mhernan10

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 ---------->
<div class="post">
<!--<header>-->
<!-- <h1 class="display-1 text-center">This is the title</h1>-->
<!--</header>-->
<div class="container-fluid bg-dark text-light">
<div class="row pt-5">
<div class="col-sm-3">
<aside class="position-sticky bg-info jumbotron">
<ul>
<li>
<a href="#" class="text-light">HOME</a>
</li>
<li>
<a href="#" class="text-light">PRODUCT</a>
</li>
<li>
<a href="#" class="text-light">ABOUT</a>
</li>
<li>
<a href="#" class="text-light">CONTACT</a>
</li>
</ul>
</aside>
</div>
<div class="col-sm-9">
<div class="card bg-dark" style="width: 40vw;">
<img class="card-img-top" src="https://i.imgur.com/VSv6Bf1.jpg" alt="Card image cap">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.position-sticky {
top: 1rem;
}
.card-title {
font-size: 2.4rem;
}
.card-body {
font-size: 2rem;
}
.col-sm-3 {
height: 400px;
background: #990;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
setTimeout({
console.log('hello world');
$('#box-0').addClass();
}, 3000);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: