HtmlAttributes Class
Attached HTML attributes to a MarkdownObject.
public class HtmlAttributes : MarkdownObject- Inheritance
MarkdownObjectHtmlAttributes
Constructors
| Name | Description |
|---|---|
| HtmlAttributes() | Initializes a new instance of the HtmlAttributes class. |
HtmlAttributes()
HtmlAttributes.csInitializes a new instance of the HtmlAttributes class.
public HtmlAttributes()Properties
| Name | Description |
|---|---|
| Classes | Gets or sets the CSS classes attached. May be null. |
| Id | Gets or sets the HTML id/identifier. May be null. |
| Properties | Gets or sets the additional properties. May be null. |
Classes
HtmlAttributes.csGets or sets the CSS classes attached. May be null.
Property value
Properties
HtmlAttributes.csGets or sets the additional properties. May be null.
public List<KeyValuePair<string, string?>>? Properties { get; set; }Property value
Methods
| Name | Description |
|---|---|
| AddClass(string) | Adds a CSS class. |
| AddProperty(string, string) | Adds a property. |
| AddPropertyIfNotExist(string, object?) | Adds the specified property only if it does not already exist. |
| CopyTo(HtmlAttributes, bool, bool) | Copies/merge the values from this instance to the specified HtmlAttributes instance. |
AddClass(string)
HtmlAttributes.csAddProperty(string, string)
HtmlAttributes.csAddPropertyIfNotExist(string, object?)
HtmlAttributes.csCopyTo(HtmlAttributes, bool, bool)
HtmlAttributes.csCopies/merge the values from this instance to the specified HtmlAttributes instance.
public void CopyTo(HtmlAttributes htmlAttributes, bool mergeIdAndProperties = false, bool shared = true)Parameters
htmlAttributesHtmlAttributes- The HTML attributes.
mergeIdAndPropertiesbool- If set to
trueit will merge properties to the target htmlAttributes. Default isfalse sharedbool- If set to
trueit will try to share Classes and Properties if destination don't have them, otherwise it will make a copy. Default istrue