Pregunta



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.

¿Fue útil?

Solución


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

Otros consejos

Try below code:

LabelID.Style.Add("line-height", "100px")
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top