When I am setting up an online chat function, here is a brief overview of the client-side code I use:
.msgln {
margin: 0 0 2px 0;
padding: 0.5%;
border: 3px solid #eee;
}
#chatbox {
text-align: left;
margin: 0 auto;
margin-bottom: 25px;
background: #fff;
height: 50%;
width: 100%;
overflow: auto;
background-color: white;
}
<div id="chatbox" style="list-style: none;">
<li>
<div class="msgln" data-user="Example">(current date)<b>Example</b>: <br/>The quick brown fox jumped over the lazy dog.
</div>
</li>
</div>
The issue I'm facing is that the scroll bar only appears on the entire page and not within the #chatbox
itself. This means users have to scroll back to the top to access the page header (and signout button) and then return to the bottom to view new messages.