Description
The MarginTop
property in the BaseStyles
class represents the margin-top
CSS property. It is used to set the top margin of an element, which is the space outside the element's border. This property can be set to a specific length value or percentage, and it is nullable, meaning it can also be set to null
to indicate that no specific margin is applied.
Usage
To use the MarginTop
property, you can assign it a value of type Sandbox.UI.Length
, which can represent various units such as pixels, percentages, or other CSS length units. If you want to remove the top margin, you can set this property to null
.
Example
// Example of setting the MarginTop property
BaseStyles styles = new BaseStyles();
styles.MarginTop = new Length(10, LengthUnit.Pixel); // Sets the top margin to 10 pixels
// Example of removing the top margin
styles.MarginTop = null;