Is it possible in css to specify a block with a set maximum width, that if the text does not fit in 1 line, then you need not the maximum width, but specifically the width of the text?
Those. so that the first block looks like 2.
.test { max-width: 500px; background: red; padding: 10px; word-wrap: normal; } .test2 { max-width: 380px; background: red; padding: 10px; } <div class="test"> Введите адрес Вашей электронной почты, например, text@example123.ru. </div> <br/> <div class="test2"> Введите адрес Вашей электронной почты, например, text@example123.ru. </div>