user2178521 user2178521 - 21 days ago 11
CSS Question

Display data in div from bottom to top in chat box

I have a chat message fetch data out and place in div

ORDER BY message_id DESC LIMIT 10


datas fetch out desc and limit 10 and use while loop out put all data.

the data is from top to bottom now.

however I need the data display from bottom to top

so the update message will display at bottom.

Answer

What you need is display: table; and display: table-cell; properties

div.wrap {
    display: table;
    height: 300px;
    width: 200px;
    background: #eee;
}

div.cell {
    display: table-cell;
    vertical-align: bottom;
    padding: 5px;
}

div.cell span {
    display: block;
    padding: 5px;
}

Demo

Comments