I am currently working on implementing a Sticky Header feature, where the header will expand (depicted by the Green Box) if the user selects more documents in the left grid (not shown).
I need help figuring out how to achieve this, as most resources recommend using position: fixed
for sticky headers with a fixed padding-top
on the body.
Issue - The blue sticky header is currently overlapping the Green box when additional document titles are added.
Below are 3 boxes: Black represents the overall container, Green is the top Sticky Header, and Blue denotes the Body content.
The objective is to ensure that the Sticky Header remains fixed while allowing users to scroll down through the lengthy body content.
As an alternative, I am currently using the JavaScript code snippet below, but I am curious if there is a way to achieve this purely with CSS and flexbox without involving JavaScript:
document.getElementById("bluebox-body-id").style.paddingTop = (50 * numberOfDocuments).toString()+ "px";
https://i.sstatic.net/nZ0dh.png
https://www.w3schools.com/howto/howto_css_fixed_menu.asp
Just a heads up, I am utilizing the Angular framework for this project.