This documentation is archived and is not being maintained.

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 nameDescription
BackgroundColorSpecifies the HTML backgroundcolor style.
BackgroundImageSpecifies the HTML backgroundimage style.
BorderCollapseSpecifies the HTML bordercollapse style.
BorderColorSpecifies the HTML bordercolor style.
BorderStyleSpecifies the HTML borderstyle style.
BorderWidthSpecifies the HTML borderwidth style.
ColorSpecifies the HTML color style.
FontFamilySpecifies the HTML fontfamily style.
FontSizeSpecifies the HTML fontsize style.
FontStyleSpecifies the HTML fontstyle style.
FontWeightSpecifies the HTML fontheight style.
HeightSpecifies the HTML height style.
TextDecorationSpecifies the HTML textdecoration style.
WidthSpecifies the HTML width style.
ListStyleImageSpecifies the HTML liststyleimage style.
ListStyleTypeSpecifies the HTML liststyletype style.
CursorSpecifies the HTML cursor style.
DirectionSpecifies the HTML direction style.
DisplaySpecifies the HTML display style.
FilterSpecifies the HTML filter style.
FontVariantSpecifies the HTML fontvariant style.
LeftSpecifies the HTML left style.
MarginSpecifies the HTML margin style.
MarginBottomSpecifies the HTML marginbottom style.
MarginLeftSpecifies the HTML marginleft style.
MarginRightSpecifies the HTML marginright style.
MarginTopSpecifies the HTML margintop style.
OverflowSpecifies the HTML overflow style.
OverflowXSpecifies the HTML overflowx style.
OverflowYSpecifies the HTML overflowy style.
PaddingSpecifies the HTML padding style.
PaddingBottomSpecifies the HTML paddingbottom style.
PaddingLeftSpecifies the HTML paddingleft style.
PaddingRightSpecifies the HTML paddingright style.
PaddingTopSpecifies the HTML paddingtop style.
PositionSpecifies the HTML position style.
TextAlignSpecifies the HTML textalign style.
VerticalAlignSpecifies the HTML verticalalign style.
TextOverflowSpecifies the HTML textoverflow style.
TopSpecifies the HTML top style.
VisibilitySpecifies the HTML visibility style.
WhiteSpaceSpecifies the HTML whitespace style.
ZIndexSpecifies 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
Show: