Ramakant Shukla
Ramakant Shukla

Reputation: 147

How to create multiline label in html

I am stuck on create multiline label in html and MVC3 also (using razor engine). Please give idea idea if you have. Thanks.

Upvotes: 0

Views: 4136

Answers (2)

Tawab Wakil
Tawab Wakil

Reputation: 2333

You can use the Label MVC Helper method to render the label, and the white-space CSS property to make it multi-line:

<div style="white-space:pre-wrap">@Html.Label("", Model.MyMultiLineText)</div>

Upvotes: 0

Ramakant Shukla
Ramakant Shukla

Reputation: 147

I used the code below and resolve the problem:

word-wrap: break-word;

Upvotes: 1

Related Questions