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"

3

1 Answer 1

2

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

Demo

.msg{
  display: inline-block;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.