Hi there!
I’m trying to figure out how to fix the position of my top container to my glide page (mobile & desktop).
I’ve read these threads:
https://community.glideapps.com/t/css-sticky-component-how-to/52172/3
https://community.glideapps.com/t/fixed-effect-with-css/41614
https://community.glideapps.com/t/freezing-certain-components/39993
Here’s a screenshot of my editor:
My goal here is to fix at the top of the screen - right below the green nav bar - my “Recap” container with its three title components. As you can see in my screenshot, “Recap” is the first component of my page and the titles are components #2, #3 and #4.
I have four rich text components, the first contains this CSS snippet:
<pre><span><style>
div[id*='screenScrollView'] > div > :nth-of-type(1) {
position: -webkit-sticky;
position: sticky;
top: 0;
background: white;
z-index: 0;
}
For the three others, I just increment the value of nth-of-type() and z-index by 1.
I don’t know if I need one rich text component with CSS to fix my top container only or 4 to fix the container and the 3 titles in it (I’ve tried both and read this post after).
I’ve tried every bits of CSS code posted by @ThinhDinh @Uzo @Himaladin in the topics here and there about how to make a component sticky while scrolling, nothing worked. I’m clearly missing something important here as I’ve also tried to just color a separator line in blue and even this very simple CSS snippet is not working when I add a separator component to my page.
Does CSS snippets still work in Glide? What am I missing here?
Thanks for your help!