I am currently working on developing a chat system similar to Facebook Messenger, where new messages are displayed at the bottom. However, I want to include a header that remains fixed in position with the last message and keep a scrollbar for navigation.
It seems that setting "height:auto" in the chat div allows it to flow naturally, which maintains dynamic chat height. If anyone has a better solution to ensure messages stay at the bottom, with the header at the top becoming sticky when messages reach it, please share your insights.