Archived topic
Sticky sidebar - last child only
3 replies · Started by Matic on October 21, 2020
Hey,
I know that a similar problem has already been resolved here, but the solution does not work for me.
I can make the entire right sidebar sticky by using:
#right-sidebar {
position: sticky;
position: -webkit-sticky;
top: 0px;
}
I tried selectors:
.sidebar-primary .widget:last-child
.inside-right-sidebar aside:last-child
.separate-containers .widget:last-child, .widget:last-child
None of them worked or they made the entire sidebar sticky.
Cheers,
Matic
Hi,
I've checked your site and I don't see the CSS code on inspection.
I see that you're using a caching plugin. Perhaps disabling or purging the cache will show an updated version of your CSS codes. Can you try disabling the caching plugin or purging its cache?
It's not there atm, I disabled/removed it, because having the entire right sidebar sticky didn't look alright.
I know what I did wrong previously. I removed
.site-content {
display: flex;
}
because it kinda messed up my site structure, because I have floats. I now added the "flex" and introduced "margin-left" to the sidebar, so it is working once again.
Careless mistake on my part. Thank you!
Good find.
No problem. :)