ASP.NET CssClassProperty


Web 控件标准属性参考手册Web Control Standard Property Reference Manual

Definition and Usage

The CssClass property is used to set or return the CSS style class for a control.

Syntax

<asp:webcontrol id="id" CssClass="style" runat="server" />
 
Property Description
style A string value that specifies the CSS class to use on the control.


Example

The following example sets the CSS style for a button:

<style>
.TestStyle
  {
  font: 12pt verdana;
  font-weight:700;
  color:orange;
  }
</style>

<form runat="server">
<asp:Button id="Button" CssClass="TestStyle"
Text="Submit" runat="server"/>
</form>

Show Example »

Web 控件标准属性参考手册Web Control Standard Property Reference Manual Other Extensions