API Reference
Class
Style
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
- 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
- CSS selector to apply.
- properties System.Collections.Generic.Dictionary{System.String,System.String}
- Dictionary of CSS properties.
Methods
public Style Add(String property, String value) #Returns:
StyleAdds or updates a CSS property.
Parameters
- property System.String
- Name of the CSS property.
- value System.String
- Value to assign.
Returns
The current Style instance.
public override String ToString() #Returns:
StringReturns a formatted CSS representation of the style.