"Sticky Sidebar"
Bootstrap 4.1.1 Snippet by SANTANU CHOWDHURY

<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="container"> <div class="row"> <div class="col-md-7 make_me_sticky"> <img src="https://dummyimage.com/700x500/ddd/aaa" class="img-responsive " alt=""> </div> <div class="col-md-5"> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus cupiditate, illo incidunt totam necessitatibus corrupti nisi et voluptatem saepe voluptatibus fugit autem error commodi corporis, architecto molestias? Molestias, reiciendis, aspernatur?</p> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus cupiditate, illo incidunt totam necessitatibus corrupti nisi et voluptatem saepe voluptatibus fugit autem error commodi corporis, architecto molestias? Molestias, reiciendis, aspernatur?</p> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus cupiditate, illo incidunt totam necessitatibus corrupti nisi et voluptatem saepe voluptatibus fugit autem error commodi corporis, architecto molestias? Molestias, reiciendis, aspernatur?</p> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus cupiditate, illo incidunt totam necessitatibus corrupti nisi et voluptatem saepe voluptatibus fugit autem error commodi corporis, architecto molestias? Molestias, reiciendis, aspernatur?</p> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus cupiditate, illo incidunt totam necessitatibus corrupti nisi et voluptatem saepe voluptatibus fugit autem error commodi corporis, architecto molestias? Molestias, reiciendis, aspernatur?</p> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Temporibus cupiditate, illo incidunt totam necessitatibus corrupti nisi et voluptatem saepe voluptatibus fugit autem error commodi corporis, architecto molestias? Molestias, reiciendis, aspernatur?</p> </div> </div> </div>
.img-responsive{ max-width:100%; } .make_me_sticky { display: block; position: sticky; top: 20px; } @media(max-width:767px){ .make_me_sticky { display: initial;; } }

Related: See More


Questions / Comments: