Description
The MinHeight
property in the BaseStyles
class represents the min-height
CSS property. It is used to set the minimum height of an element, ensuring that the element is not rendered smaller than the specified height. This property is particularly useful for maintaining layout consistency and preventing elements from collapsing when content is smaller than expected.
Usage
To use the MinHeight
property, assign it a value of type Sandbox.UI.Length
. This can be a specific length value such as pixels, percentages, or any other valid CSS length unit. The property is nullable, meaning it can be set to null
if no minimum height is desired.
Example
// Example of setting the MinHeight property
var styles = new BaseStyles();
styles.MinHeight = new Length(100, LengthUnit.Pixel); // Sets the minimum height to 100 pixels
// Example of clearing the MinHeight property
styles.MinHeight = null; // Removes the minimum height constraint