ASP.NET Style Attribute

Definition and Usage

The Style attribute is used to set or return inline CSS styles for controls.

Syntax

<asp:webcontrol id="id" Style="style" runat="server" />
Value Description
style A string, the value of which is the CSS style specified for the inline style sheet.

Example

This example sets the CSS style for the button control:

<form runat="server">
<asp:Button id="Button" Text="Submit" runat="server"
Style="font: 12pt Verdana; font-weight:700; color:orange;" />
</form>

Example

Add Styles to Button Controls Using the style Attribute