如何调整标签的字符间距

时间:2012-07-12 12:46:28

标签: c# asp.net label

如何调整标签控件中的字符间距。酒店窗口没有这样的房产。

<asp:Label ID="label01" runat="server" Text="EXPLORATIONS" Font-Bold="True"     
Font-Names="Verdana" Font-Size="Small" ForeColor="#999999"></asp:Label>

3 个答案:

答案 0 :(得分:5)

您可以使用CSS letter-spacing property

<asp:Label ID="label01" runat="server" Text="EXPLORATIONS" Font-Bold="True" Font-Names="Verdana" Font-Size="Small" ForeColor="#999999" CssClass="YourStyle" />

<style>
.YourStyle
{
    letter-spacing: 4px;
}
</style>

答案 1 :(得分:4)

您可以将CssClass应用于Label控件,您可以在其中提供字母间距。

像这样的东西

<style type="text/css">
        .spacing
        {
            letter-spacing:12px;
        }
</style>

<asp:Label ID="Label1" runat="server" Text="Your nice text line" 
      CssClass="spacing" />

答案 2 :(得分:4)

使用,您可以调整letter spacing

label#label01{
    letter-spacing: 1em;
}