In this video tutorial, I’ll guide you on how to create a sticky sidebar on scroll. You may have seen the sticky banner or sticky widget on many sites. These floating banners or sidebars help in promoting any particular course or campaign. You can create the sticky sidebar in WordPress by using the CSS codes given below.
#stickysidebar #stickybanner #stickywidget, #GeneratePress #GeneratePressTutorial
๐ GeneratePress Theme- https://www.dabasblog.com/go/generatepress/
๐ GeneratePress Review- https://www.dabasblog.com/generatepress-review/
๐ CSS Codes ==
/*last widget sticky*/
@media(min-width: 1024px) {
.site-content {
display: flex;
}
.inside-right-sidebar {
height: 100%;
}
.inside-right-sidebar .widget:last-of-type {
position: sticky;
position: -webkit-sticky;
top: 60px;
}
}/*last widget sticky*/
————————————————————————————————————–
/*sticky sidebar*/
@media (min-width: 769px) {
#right-sidebar {
position: -webkit-sticky;
position: sticky;
top: 0;
}
}
/*sticky sidebar*/
—————————————————————————————————————
๐ฅ๐ฅ๐ฅ Recommended SEO Tools ๐ฅ๐ฅ๐ฅ
* SEMrush — https://www.dabasblog.com/go/semrush-free-trial/
* SE Ranking Tool — https://www.dabasblog.com/go/se-ranking/
source