Description
The MarginLeft
property in the BaseStyles
class represents the margin-left
CSS property. It is used to set the left margin of an element, which is the space outside the element's border on the left side. This property can be set to a specific length value or left as null
to use the default margin.
Usage
To use the MarginLeft
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 do not want to set a specific margin, you can leave it as null
.
Example
// Example of setting the MarginLeft property
BaseStyles styles = new BaseStyles();
styles.MarginLeft = new Length(10, LengthUnit.Pixel); // Sets the left margin to 10 pixels
// Example of leaving the MarginLeft property unset
styles.MarginLeft = null; // Uses the default margin