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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -