Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP.NET Style Font Property

ASP.NET Font Property


Style Control the Style control


Definition and Usage

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

Syntax

webcontrol

id="

id

" font-

subproperty

=

"value"

runat="server"

/>

Font sub-properties

Value Description
Bold The bold sub-property. Possible values are: TRUE or FALSE.
Italic The italic sub-property. Possible values are: TRUE or FALSE.
Name The font name property (e.g. "Verdana" or "Arial"). When you set this property, the Names property is automatically updated with a single-element array holding the value of the Name property.
Names An array of font names. When you set this property, the Name property is automatically updated using the first element of the array.
Strikeout The strike-through sub-property. Possible values are: TRUE or FALSE.
Underline The underline sub-property. Possible values are: TRUE or FALSE.
Size The font size sub-property. Specifies the font size.

Example

The following example sets the font of a Button control:

Font-Name="Verdana" Font-Size="15" runat="server"/>

Demo Example »


Try it - Demo

Set the Button control's font (with declaration and script)


Style Control the Style control