Question



In my webpage there is label having multiple lines of text.
I need to add line-height property to that label in asp.net.

Thanks.

Était-ce utile?

La solution


There are 2 ways to do this.

1) add a style for this. and give cssClass for that label.For example,

.line
{
  line-height:150%;
}

And add the class to your label.

<asp:Label ID="Label1" runat="server" cssClass="line" />

2) Add style in code behind

Label1.Style.Add("line-height","150%");


Change the line-height value to whatever you want

Autres conseils

Try below code:

LabelID.Style.Add("line-height", "100px")
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top