Select your language
Problem: We want to display course overview and action buttons in its landing page. The best way is to use bootstrap 5 and apply sticky CSS feature.
Solution
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sticky Side Div</title> <link href="https://cdn.jsdelivr.net/npm/This email address is being protected from spambots. You need JavaScript enabled to view it./dist/css/bootstrap.min.css" rel="stylesheet"> <style> /* Optional: Add some custom styling */ .sticky-div { top: 20px; /* Adjust the distance from the top */ } </style> </head> <body> <div class="container"> <div class="row"> <div class="col-12 col-md-3"> <style> .sticky-div { top: 20px; /* Adjust the distance from the top */ } </style> <div class="sticky-div position-sticky"> <div class="card"> <div class="card-body"> <h5 class="card-title">Sticky Sidebar</h5> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">This sidebar stays visible while scrolling.</p> <p class="card-text">End</p> </div> </div> </div> </div> <div class="col-md-9"> <h1>Main Content</h1> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin luctus, velit non aliquet tincidunt, eros felis ullamcorper nulla, in tempus lacus risus eget mauris. Suspendisse potenti. </p> <p>... (Add more content to make the page scrollable) ...</p> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/This email address is being protected from spambots. You need JavaScript enabled to view it./dist/js/bootstrap.bundle.min.js"></script> </body> </html>; Hope this helped.
Still need help! no problem, feel free to contact us Today
Abdul Waheed : (Hire Joomla & PHP Pakistani Freelancer)