I have a problem with basics of css. I want to show message in chat like WhatsApp or other chat apps. If text is shorter than max-width of the container, it works fine. But if this text is longer than max-width, than text is wrapped on new lines and takes max-width of the container, even if every its string is shorter. It looks like empty space right of the text.
What is the best way to show messages in my case? Is it possible without scripts?
.container {
max-width: 400px;
background: green;
}
<div class="container">
test_test_test_test_test_test_test_test test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test test_test_test_test_test_test_test_test
</div>