Export (0) Print
Expand All
Expand Minimize

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.
CursorSpecifies the HTML cursor style.
DirectionSpecifies the HTML direction style.
DisplaySpecifies the HTML display style.
FilterSpecifies the HTML filter style.
FontFamilySpecifies the HTML fontfamily style.
FontSizeSpecifies the HTML fontsize style.
FontStyleSpecifies the HTML fontstyle style.
FontVariantSpecifies the HTML fontvariant style.
FontWeightSpecifies the HTML fontheight style.
HeightSpecifies the HTML height style.
LeftSpecifies the HTML left style.
ListStyleImageSpecifies the HTML liststyleimage style.
ListStyleTypeSpecifies the HTML liststyletype 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.
TextDecorationSpecifies the HTML textdecoration style.
TextOverflowSpecifies the HTML textoverflow style.
TopSpecifies the HTML top style.
VerticalAlignSpecifies the HTML verticalalign style.
VisibilitySpecifies the HTML visibility style.
WhiteSpaceSpecifies the HTML whitespace style.
WidthSpecifies the HTML width 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");

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft