2
I have a variable that receives a text, I would like to insert a line break in that text after character number 40 in jQuery.
That line especially:
$(".chat").append('<li class="other"><div class="msg"><span>' + client + ':</span><p>' + msg + '</p><time>' + time.getHours() + ':' + time.getMinutes() + '</time></div></li>');
The variable msg
would need to receive a line break after character 40 to fit inside the div
horizontally, vertically to div
can grow as much as it is, horizontally no, should keep 200px or less.
DIV:
.msg {
background: white;
min-width: 50px;
max-width: 200px;
padding: 10px;
border-radius: 20px;
box-shadow: 0px 2px 0px rgba(0, 0, 0, 0.07);
}
It has how to put the code you have at the moment?
– PauloHDSousa