I'm still learning HTML/CSS, so please expect a naive question below. With that said, I'd like to create a webpage (not the pop-up chat boxes or mobile type chat interfaces) to mock a simple chat interface.
Q1: I'd like to know which HTML element to use to insert chat instances. If I put it all in a <div id='chats'>
, everytime I add new instances (new incoming chats), the page will just get longer. I'd like to limit the window to show these chat instances in a frame, so the length of the webpage stay constant. Then the user can scroll up and down within that window to read the chats. How do I accomplish that? I think StackOverflow does it for recommending questions that may have answers to my question and it uses overflow-y: scroll
. Is that the way to go?
Q2: Supposed I use overflow-y: scroll
, how could I keep the lastest chat instance always be the one to show after reloading? I assume that if I add a new chat <div>
, it will not gain focus unless I do something special to call the focus on it?
Q3: Is there open-source chat UI for webpages that anyone would recommend?
Thank you for all your answers!