css - How to wrap the text in the DisplayFor in MVC view? -


comments extends developing mvc app. have commenting feature in app.

my problem is, when user posts comments without pressing enter key, comment comes out 1 single line , crosses screen , user has scroll horizontally see entire comment.

i want wrap comment , show @ specific width.

ex.

admin 04 may 13 12:43 pm zxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxca

i use below code show comments in view

<div class="commentp" style="width:550px;" >  @html.displayfor(modelitem => item.commenttext, new {style = "width:550px;" }) </div> 

use <div style="word-wrap:break-word;"> or <div style="overflow:auto;">


Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -