My goal is to design a webpage with five distinct regions, out of which three are meant to be sticky. However, while implementing this feature, I encountered an issue - when the user scrolls to the right beyond the viewport width, the left sticky elements disappear. Since I cannot predict the width of the content in advance, I am looking for a solution to allow these elements to automatically expand based on their content. Is there a way to ensure that the left elements remain visible even when the user scrolls all the way to the right?
The regions I have defined are as follows:
header
- This region should disappear when the user scrolls vertically.upperleft
- This region is a small column header that remains sticky to the left and top while scrolling.upperright
- This region should stick only to the top while scrolling vertically. It should be hidden behindupperleft
when the user scrolls to the right.bottomleft
- This region should stick to the left side of the screen when the user scrolls to the right and disappear behindupperleft
when the user scrolls down.bottomright
- This region should be hidden behindupperleft
,upperright
, andbottomleft
based on the user's scrolling actions.
Below is a sample code snippet illustrating the issue (tested on Firefox 62.0.3):
<!-- CSS code here-->
<!-- HTML code here-->