Margin

Control the outer spacing of an element.

margin creates space around an element, outside of any defined borders.

Example

Loading Preview…

Quick Notes

  • margin requires all four Rect fields: left, right, top, and bottom. Use scalar properties such as marginBottom to set individual edges.
  • Edges accept numbers, percentage strings, or "auto". Auto margins absorb available space according to the layout mode; for example, left and right auto margins can center a fixed-width block horizontally.

Next Steps

© 2026 ByteLand Technology Limited