Archived topic
Sticky sdebar css help
8 replies · Started by johnaps on April 8, 2020
Hello GP Team!! :)
Can you tell me if it is possible to offset the left sticky sidebar widget to have an y padding from the bottom everytime?
http://thefinterestcom.kinsta.cloud/uncategorized/hello-world/
Hi there,
you would need to look to see if thats an option in the sticky JS script you're using.
It does have
Additional top margin (in px)
Additional bottom margin (in px)
options but no matter what value i input, it doesnt do anything i am afraid! I found this plugin i am using from this post https://generatepress.com/forums/topic/sticky-sidebar/page/3/#post-1230620
Its ok though, if there isnt a ready easy solution for this i ll search around!! Thank you!
Yeah unfortunately can't advise on how that plugin operates.
If its just the one side bar you want to stick then CSS linked below can work for the #left-sidebar too:
https://generatepress.com/forums/topic/how-to-make-the-sidebar-static/#post-784512
Thank you David, thats a perfect alternative as i didnt want to use a plugin for that.
I implemented the css code you suggested and it worked, with a little but on the position of left sidebar.
https://imgur.com/a/NqjHprl
http://thefinterestcom.kinsta.cloud/hello-world/
Maybe you could also know why this is happening??
I think i found a solution , but i dont think its a clean one
@media (min-width: 990px) {
#left-sidebar {
position: -webkit-sticky;
position: sticky;
top: -2%;
margin-left: -60%;
margin-bottom: 400px;
}
#right-sidebar {
margin-left: 20%;
}
}
Perhaps you have something better in mind?
Looks good to me :)
Good to hear that :) !