ASP.NET ForeColorProperty


Style 控件Style Control

Definition and Usage

The ForeColor property is used to set or return the foreground color of a control (usually the color of the text).

Syntax

<asp:webcontrol id="id" ForeColor="color" runat="server" />

Property Description
color The color to set as the foreground color of the control. Must be a validHTML color。


Example

The following example sets the foreground color of a button:

<form runat="server">
<asp:Button id="button1" Text="Submit"
ForeColor="#FF0000" runat="server" />
</form>

Demo Example »

Try it Yourself - Demo

Set the text color of a Button control (with declaration and script)


Style 控件Style Control Other Extensions