HtmlTextWriter.StyleEqualsChar HtmlTextWriter.StyleEqualsChar HtmlTextWriter.StyleEqualsChar HtmlTextWriter.StyleEqualsChar Field

定義

表示樣式等號 (:) 字元,此字元用來設定樣式屬性等於值。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 

欄位值

範例

下列程式碼範例示範如何FontWeight將的屬性和bold值轉譯為專案的開頭標記。The following code example demonstrates how to render a FontWeight attribute and value of bold to the opening tag of an element. 此程式碼範例會Write使用方法StyleEqualsChar搭配欄位做為參數,以轉譯可設定每個樣式屬性值的字元。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)

備註

此欄位是WriteStyleAttribute由方法用來分隔樣式名稱和值。 StyleEqualsCharThe StyleEqualsChar field is used by the WriteStyleAttribute method to delimit style names and values.

適用於

另請參閱