"Expanding card"
Bootstrap 4.1.1 Snippet by dipakextra

<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"> <body> <div class="image-container"> <div class="image image1"> <img src="https://images.unsplash.com/photo-1471922694854-ff1b63b20054?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1052&q=80" alt="sea"> <h3 class="image-tittle">sea beach</h3> </div> <div class="image image1"> <img src="https://images.unsplash.com/photo-1486072889922-9aea1fc0a34d?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8bW91dGFpbnxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60" alt="sea"> <h3 class="image-tittle">moutain</h3> </div> <div class="image image2"> <img src="https://images.unsplash.com/photo-1616849675415-d0f1727e2559?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80" alt="sea"> <h3 class="image-tittle">sunset</h3> </div> <div class="image image3 active"> <img src="https://images.unsplash.com/photo-1541423408854-5df732b6f6d1?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80" alt="sea"> <h3 class="image-tittle">city at night</h3> </div> </div> </body> </div> </div>
html { font-size: 62.5%; } * { margin: 0; padding: 0; box-sizing: border-box; } body { height: 100vh; background-color: #90caf9; padding: 5rem; display: flex; align-items: center; justify-content: center; } .image-container { width: 90%; height: 100%; display: flex; overflow: hidden; } .image { position: relative; flex: 0.4; margin-right: 1rem; border-radius: 3px; transition: flex 1s ease-in; cursor: pointer; } .image img { width: 100%; height: 100%; object-fit: cover; border-radius: 50px; } .image.active { flex: 5; } .image-tittle { color: white; position: absolute; top: 80%; left: 0; margin-left: 3rem; font-size: 3rem; text-transform: capitalize; opacity: 0; } .image.active .image-tittle { opacity: 1; transition: opacity 0.3s ease-in 0.4s; }
const images = document.querySelectorAll(".image"); if (images) { images.forEach((image) => { image.onclick = () => { document.querySelector(".active").classList.remove("active"); image.classList.add("active"); }; }); }

Related: See More


Questions / Comments: