I am developing a MVC app.
I have a commenting feature in the app.
My problem is, when any user posts a comments without pressing the enter key, then the comment comes out as one single line and crosses the screen and the user has to scroll horizontally to see the entire comment.
I want to wrap the comment and show it at a specific width.
Ex.
admin 04 May 13 12:43 PM zxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxcasdasdzxczxca
I use the below code to show the comments in the 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;">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With