HtmlForgeX

API Reference

Class

Style

Namespace HtmlForgeX
Assembly HtmlForgeX

Represents a simple CSS style definition that can be attached to an element or output as part of a <style> block when rendering a document.

Inheritance

  • Object
  • Style

Remarks

This type can be used to build inline style declarations or generate style blocks for inclusion in a document.

Constructors

Style 3 overloads
public Style(String selector) #

Initializes a new instance of the Style class using a selector.

Parameters

selector System.String requiredposition: 0
CSS selector to apply.
public Style(String selector, Dictionary<String, String> properties) #

Initializes a new instance of the Style class with a selector and properties.

Parameters

selector System.String requiredposition: 0
CSS selector to apply.
properties System.Collections.Generic.Dictionary{System.String,System.String} requiredposition: 1
Dictionary of CSS properties.
public Style() #

Initializes a new instance of the Style class.

Methods

public Style Add(String property, String value) #
Returns: Style

Adds or updates a CSS property.

Parameters

property System.String requiredposition: 0
Name of the CSS property.
value System.String requiredposition: 1
Value to assign.

Returns

The current Style instance.

public override String ToString() #
Returns: String

Returns a formatted CSS representation of the style.

Properties

public String Selector { get; set; } #

Gets or sets the CSS selector associated with the style.

public Dictionary<String, String> Properties { get; set; } #

Gets the collection of CSS properties for this style.