Latest web development tutorials

ASP.NET Font Properties

Web Control Standard Properties Reference Web Control Standard Properties Reference

Definition and Usage

Font property is used to set or return the control font.

grammar

<asp:webcontrolid="id" font-subproperty="value"runat="server" />

Font sub-attribute

描述
Bold 粗体子属性。可能的值是:TRUE 或 FALSE。
Italic 斜体子属性。可能的值是:TRUE 或 FALSE。
Name 字体名称属性(比如:"Verdana" 或 "Arial")。当您设置了该属性,则通过带有 Name 属性的值的单个元素数组来自动更新 Names 属性。
Names 字体名称的数组。当您设置了该属性,则使用该数组中的第一个元素来自动更新 Name 属性。
Strikeout 删除线子属性。可能的值是:TRUE 或 FALSE。
Underline 下划线子属性。可能的值是:TRUE 或 FALSE。
Size 字体尺寸子属性。规定字体尺寸。


Examples

The following example sets the Button control's Font:

<form runat="server">
<asp:Button id="Button1" Text="Submit"
Font-Name="Verdana" Font-Size="15" runat="server"/>
</form>

The demonstration >>

Web Control Standard Properties Reference Web Control Standard Properties Reference