Uredi

Deli z drugimi prek


HtmlTextWriter.StyleEqualsChar Field

Definition

Represents the style equals (:) character used to set style attributes equal to values.

public: char StyleEqualsChar;
public const char StyleEqualsChar;
val mutable StyleEqualsChar : char
Public Const StyleEqualsChar As Char 

Field Value

Examples

The following code example demonstrates how to render a FontWeight attribute and value of bold to the opening tag of an element. The code example uses the Write method with the StyleEqualsChar field as the parameter to render the character that sets the value of each style attribute.

This code example renders the following markup:

FontWeight:"bold"

// Write a space and a FontWeight
// attribute to the tag.
writer.Write(HtmlTextWriter.SpaceChar);
writer.Write("FontWeight");

// Set the FontWeight attribute to Bold.
writer.Write(HtmlTextWriter.StyleEqualsChar);
writer.Write(HtmlTextWriter.DoubleQuoteChar);
writer.Write("bold");
writer.Write(HtmlTextWriter.DoubleQuoteChar);
' Write a space and a FontWeight
' attribute to the tag.
writer.Write(HtmlTextWriter.SpaceChar)
writer.Write("FontWeight")

' Set the FontWeight attribute to Bold.
writer.Write(HtmlTextWriter.StyleEqualsChar)
writer.Write(HtmlTextWriter.DoubleQuoteChar)
writer.Write("bold")
writer.Write(HtmlTextWriter.DoubleQuoteChar)

Remarks

The StyleEqualsChar field is used by the WriteStyleAttribute method to delimit style names and values.

Applies to

See also