I want my scrollable container to automatically scroll to the bottom when a new element is added. Any way I could achieve this?
style:
.container {
overflow: auto;
width: 800px;
height: 500px;
line-height: 3em;
overflow: auto;
padding:5px;
}
code:
<h1>{% block title %} Messages {% endblock %}</h1>
<div class="container">
{% for message in messages %}
<div class='message'>
<h3>{{ message['title'] }}</h3>
<p>{{ message['content'] }}</p>
</div>
{% endfor %}
</div>