共用方式為


HtmlElement.CssClass Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the cascading style sheet (CSS) class string for the current HTML element.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

Syntax

'Declaration
Public Property CssClass As String
public string CssClass { get; set; }

Property Value

Type: System.String
A CSS class string if the element is associated with a CSS class; otherwise, an empty string.

Remarks

An element can have more than one CSS class associated with it.

This property can be set to an empty string or nulla null reference (Nothing in Visual Basic).

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.