Wondering how I can position a list so the last item is always the first to be visible, I've positioned the list absolute: bottom
but not sure how to make the contents scrollable, can anyone offer any suggestions? Is there a way of doing this with flex box? My problem is for the contents scroll I have to set height: 100%
on div.chat__inner
, this immediately jumps the list to the top.
CSS
.chat {
position: relative;
height: 200px;
width: 200px;
border: 1px solid #000;
overflow: hidden;
}
.chat__inner {
position: absolute;
bottom: 0;
}
.messages {
overflow: auto;
-webkit-user-select: none;
-webkit-overflow-scrolling: touch;
height: 100%;
margin: auto;
}