【问题标题】:How can I increase space between lines within the text shown in the ASP.NET label?如何增加 ASP.NET 标签中显示的文本中的行间距?
【发布时间】:2013-11-10 10:19:37
【问题描述】:

我在ASP.NET C# 应用程序中有一个label

runtime,ASP.NET 的label 值获取带有文本的populated

ASPX 文件中,我们有以下代码:

<asp:Label ID="commentLabelForGridView" runat="server" 
      Style="text-align:left;" font-size="1.75em" ></asp:Label>

code-behind CS 文件中,我们有以下代码:

commentLabelForGridView.Text = "BlahBlahBlah........Blah...................";

当 ASP 标签中有大量文本时,页面上呈现的text 变为Multilined

问题是行与行之间没有足够的空间,因此看起来很拥挤,因此难以阅读。

如何增加 ASP.NET 标签中显示的文本中的行间距?

【问题讨论】:

  • 样式应该有一个可以设置的行高属性。

标签: c# asp.net css label spacing


【解决方案1】:

在 Style 中添加 line-height 属性...

<asp:Label ID="commentLabelForGridView" runat="server" 
      Style="text-align:left; line-height:1.5px" font-size="1.75em" ></asp:Label>

... 它可以是: 行高:1.5px 或 行高:100%

希望对你有帮助..

【讨论】:

    【解决方案2】:

    感谢 @user2025312 提到修改 line-height 属性应该会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-01
      • 2021-11-25
      • 1970-01-01
      • 2015-06-29
      相关资源
      最近更新 更多