3

I'm creating a chat application and need to align messages from users the way is done in Skype, from bottom to top.

A solution was found here, but it has couple of flaws.

  1. the height of container is a fixed height, I need to cover all available height of the window (if I use height: 100%, it shrinks completely).
  2. The height of the message item is fixed, I need it to adjust to its content height.

Having a poor experience with CSS I'm having troubles to fix these 2 issues. Can someone point to a solution?

Community
  • 1
  • 1
Eugen
  • 2,934
  • 2
  • 26
  • 47

1 Answers1

0

It could be easier if you have provided your own jsfiddle. But anyway, I'm trying to answer your question by taking @IlyaStreltsyn jsbin.

You can position to be fixed and set vertical-align bottom and apply the gap from bottom. Here I have used 0px for demonstration.

.wrapper {
  display: table-cell;
  vertical-align: bottom;
  position: fixed;
  bottom: 0;
  right: 0;
  width: 300px;
}

jsfiddle demo

Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231