I designed a layout with 1 header and 3 vertical panels. The challenge is to ensure that all the panels can expand or contract horizontally to fill up 100% of the page width collectively, while also taking up 100% of the vertical space below the header (which adjusts automatically in height).
Each panel should be scrollable individually without affecting the overall page scroll or disrupting the position of the other panels.
https://i.sstatic.net/eMOF5.jpg https://i.sstatic.net/5HyYe.jpg
The issue I am encountering is that the panels need to have relative positioning horizontally to achieve the desired width distribution, but fixed positioning vertically to maintain their place when scrolling.
Using position:sticky
would solve this problem, but it is not supported by Chrome/Opera, making it an impractical solution. Implementing JavaScript introduced its own set of issues, especially with animations during expansion/constriction, which did not provide the desired result aesthetically. Therefore, I am seeking a pure CSS solution that works seamlessly across different browsers.
The primary goal is to allow each panel to remain scrollable independently without affecting the rest of the page scroll and maintaining a "sticky" behavior throughout.
Although I am not an expert in CSS, I believe there must be a straightforward solution that I am overlooking. Any help or suggestions are greatly appreciated.