The LineHeight
property in the Sandbox.UI.BaseStyles
class represents the line-height
CSS property. This property is used to set the height of a line box, which can affect the spacing between lines of text in an element.
The LineHeight
property in the Sandbox.UI.BaseStyles
class represents the line-height
CSS property. This property is used to set the height of a line box, which can affect the spacing between lines of text in an element.
To use the LineHeight
property, you can assign it a value of type Sandbox.UI.Length
or null
. The Length
type allows you to specify the line height in various units such as pixels, percentages, or ems. Setting it to null
will remove any explicit line height setting, allowing the element to inherit the line height from its parent or use the default value.
// Example of setting the LineHeight property var styles = new BaseStyles(); styles.LineHeight = new Length(1.5f, LengthUnit.Em); // Sets line-height to 1.5em // Example of clearing the LineHeight property styles.LineHeight = null; // Removes explicit line-height setting