Anele0610 Posted November 20 Posted November 20 Site URL: https://www.practicethinkers.com/practice-thinker-app-1 Hello! Looking for a code to make the a code block sticky throughout the entire page, not just the current section. I know the code for making a section sticky, but I need this blog to over the other content. Link: https://www.practicethinkers.com/practice-thinker-app-1 The code block in question: Thanks! Anele
Squareko Posted November 21 Posted November 21 add this code into custom css: /* Make the sidebar sticky */ .sidebar { position: -webkit-sticky; /* For Safari */ position: sticky; top: 20px; /* Adjust this value to control how far from the top the sidebar stays */ z-index: 100; /* Ensure it's above other content */ }
Anele0610 Posted November 21 Author Posted November 21 26 minutes ago, Squareko said: add this code into custom css: /* Make the sidebar sticky */ .sidebar { position: -webkit-sticky; /* For Safari */ position: sticky; top: 20px; /* Adjust this value to control how far from the top the sidebar stays */ z-index: 100; /* Ensure it's above other content */ } Hey, thanks, but it doesn't work 😞
Anele0610 Posted November 22 Author Posted November 22 Does anyone have another possible solution for this?
tuanphan Posted November 25 Posted November 25 You can change to position: fixed; instead Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment