문제



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.

도움이 되었습니까?

해결책


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

다른 팁

Try below code:

LabelID.Style.Add("line-height", "100px")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top