After two days of thinking and trying and experimenting with absolute positioning, inline/inline-block display, flex display and so on... I still did not find an answer to the question - "how to style a timestamp's label position, shown on the screenshot below, with pure CSS?".
Conditions:
- a timestamp width can vary from min-width 60px to max-width 100% of the parent block (the parent has a max-width value and float right)
- if a timestamp is smaller than 100% (eg 50%), the space to the left of it should be filled with a text, and the timestamp is always aligned to the right
- if a text and a timestamp are smaller than parents max-width - they are shown on a single line (like 1st, and 2nd messages on the screenshot)
- if a timestamp can't fit in a single line with a text - it drops down and aligned to the right
- and if text can't fit in a single line (like 3rd message on the screenshot), a timestamp is shown on the second line, aligned to the right, and does not block the space above it
So far I could reach it only with JS, but I believe it is possible to make it work with pure CSS.
UPD: I've added a sandbox example for you guys, with rough code, if you will want to help me http://jsbin.com/gatifevowu/2/edit?html,css,output