Description
The MaxWidth
property in the BaseStyles
class represents the max-width
CSS property. It is used to define the maximum width of an element. This property can be set to a specific length value or left unset, which means the element can grow indefinitely in width.
Usage
To use the MaxWidth
property, assign it a value of type Sandbox.UI.Length
. This can be a specific unit like pixels, percentages, or any other CSS length unit. If you do not want to set a maximum width, you can leave it as null
.
Example
// Example of setting the MaxWidth property
var styles = new BaseStyles();
styles.MaxWidth = new Length(100, LengthUnit.Percent); // Sets max-width to 100%
// Example of clearing the MaxWidth property
styles.MaxWidth = null; // Removes the max-width constraint