I'm creating a page where the users can post comments, but I have some problems with the div
which contains th开发者_JAVA技巧e message posted. If it's too long and without line breaks, it appears a horizontal scrollbar. I would like to make the text automatically go in the following line like the comments posted in this site.
Have you got some ideas for making this happen?
I use chrome as browser and asp.net is the server language.
I create the div with:
Response.Write("<tr><td><div class=""target-div"">" & reader("commento").Replace(vbCrLf,"br/>") & "</div></td></tr>")
I think it's
.target-div {
white-space:pre-wrap;
}
pre-wrap both saves user formatting (i.e., preserves multiple white-spaces) and wrap when necessary
精彩评论