Frage



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.

War es hilfreich?

Lösung


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

Andere Tipps

Try below code:

LabelID.Style.Add("line-height", "100px")
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top