API Reference
EmailSpacing
Defines predefined spacing values for email components. These provide semantic spacing that works consistently across email clients.
Inheritance
- Enum
- EmailSpacing
Inherited Methods
public override sealed Int32 CompareTo(Object target) #Int32Parameters
- target Object
public override sealed String ToString(String format, IFormatProvider provider) #StringObsolete("The provider argument is not used. Use ToString(String) instead.")Parameters
- format String
Values
public const EmailSpacing None #No spacing - creates seamless connection between sections. Value: 0px CSS equivalent: margin: 0 auto Use when: Connecting sections without visual break
0public const EmailSpacing Minimal #Minimal spacing - just enough to separate elements slightly. Value: 4px CSS equivalent: margin: 4px auto Use when: Subtle element separation, tight layouts
1public const EmailSpacing ExtraSmall #Extra small spacing - light breathing room. Value: 8px CSS equivalent: margin: 8px auto Use when: Compact designs, mobile-friendly spacing
2public const EmailSpacing Small #Small spacing - comfortable but compact. Value: 12px CSS equivalent: margin: 12px auto Use when: Newsletter sections, compact content blocks
3public const EmailSpacing Medium #Medium spacing - balanced spacing for most content. Value: 16px CSS equivalent: margin: 16px auto Use when: Standard content separation, default spacing
4public const EmailSpacing Large #Large spacing - generous breathing room. Value: 24px CSS equivalent: margin: 24px auto Use when: Section headers, important content emphasis
5public const EmailSpacing ExtraLarge #Extra large spacing - prominent visual separation. Value: 32px CSS equivalent: margin: 32px auto Use when: Major sections, hero content, call-to-action spacing
6public const EmailSpacing DoubleExtraLarge #Double extra large spacing - maximum visual impact. Value: 48px CSS equivalent: margin: 48px auto Use when: Landing pages, dramatic section breaks, hero spacing
7public const EmailSpacing Huge #Huge spacing - for dramatic visual breaks. Value: 64px CSS equivalent: margin: 64px auto Use when: Major page sections, promotional content, special emphasis
8Extension Methods
public static String ToCssValue(EmailSpacing spacing) #StringConverts the spacing value to a CSS px value.
Parameters
- spacing HtmlForgeX.Email.EmailSpacing
- Spacing option.
Returns
Pixel string representation.