0 out of 1 rated this helpful - Rate this topic

HtmlTextWriterStyle Enumeration

Specifies the HTML styles available to an HtmlTextWriter or Html32TextWriter object output stream.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
public enum HtmlTextWriterStyle
Member name Description
BackgroundColor Specifies the HTML backgroundcolor style.
BackgroundImage Specifies the HTML backgroundimage style.
BorderCollapse Specifies the HTML bordercollapse style.
BorderColor Specifies the HTML bordercolor style.
BorderStyle Specifies the HTML borderstyle style.
BorderWidth Specifies the HTML borderwidth style.
Color Specifies the HTML color style.
FontFamily Specifies the HTML fontfamily style.
FontSize Specifies the HTML fontsize style.
FontStyle Specifies the HTML fontstyle style.
FontWeight Specifies the HTML fontheight style.
Height Specifies the HTML height style.
TextDecoration Specifies the HTML textdecoration style.
Width Specifies the HTML width style.
ListStyleImage Specifies the HTML liststyleimage style.
ListStyleType Specifies the HTML liststyletype style.
Cursor Specifies the HTML cursor style.
Direction Specifies the HTML direction style.
Display Specifies the HTML display style.
Filter Specifies the HTML filter style.
FontVariant Specifies the HTML fontvariant style.
Left Specifies the HTML left style.
Margin Specifies the HTML margin style.
MarginBottom Specifies the HTML marginbottom style.
MarginLeft Specifies the HTML marginleft style.
MarginRight Specifies the HTML marginright style.
MarginTop Specifies the HTML margintop style.
Overflow Specifies the HTML overflow style.
OverflowX Specifies the HTML overflowx style.
OverflowY Specifies the HTML overflowy style.
Padding Specifies the HTML padding style.
PaddingBottom Specifies the HTML paddingbottom style.
PaddingLeft Specifies the HTML paddingleft style.
PaddingRight Specifies the HTML paddingright style.
PaddingTop Specifies the HTML paddingtop style.
Position Specifies the HTML position style.
TextAlign Specifies the HTML textalign style.
VerticalAlign Specifies the HTML verticalalign style.
TextOverflow Specifies the HTML textoverflow style.
Top Specifies the HTML top style.
Visibility Specifies the HTML visibility style.
WhiteSpace Specifies the HTML whitespace style.
ZIndex Specifies the HTML zindex style.

HtmlTextWriter and Html32TextWriter objects use these enumeration values to register HTML strings to the proper HTML style.

The following example uses the HtmlTextWriterStyle enumeration with the AddStyleAttribute method to add a color style attribute to an HTML element and sets its value.

writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "Red");


Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ