0

I have a randomly generated content which greatly resizes the element. I receive real time msgs via javascript pusher.js library

<span class="msg" style="font-style:italic;width:30%;min-wdith:30%;max-width:30%;"> random length msg here </span><br>

I tried to have it fixed at 30% but whenever the text string msg gets super long the span ends up stretching to far end of page horizontally

This is problematic because when msg rate increases, the element, "dances"

user299709
  • 4,922
  • 10
  • 56
  • 88

1 Answers1

2

You need to change the display property of the span to inline-block

Demo

.msg{
  display: inline-block;
}
Juan
  • 4,910
  • 3
  • 37
  • 46