HtmlTextWriter.StyleEqualsChar 字段

定义

表示用于将样式属性设置为等于值的样式等号 (:) 字符。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.

适用于

另请参阅