HtmlForgeX

API Reference

Enum

EmailSpacing

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Enum
Implements
IComparable ISpanFormattable IFormattable IConvertible
Modifiers sealed

Defines predefined spacing values for email components. These provide semantic spacing that works consistently across email clients.

Inheritance

  • Enum
  • EmailSpacing

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

Value: 0
public 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

Value: 1
public const EmailSpacing ExtraSmall #

Extra small spacing - light breathing room. Value: 8px CSS equivalent: margin: 8px auto Use when: Compact designs, mobile-friendly spacing

Value: 2
public const EmailSpacing Small #

Small spacing - comfortable but compact. Value: 12px CSS equivalent: margin: 12px auto Use when: Newsletter sections, compact content blocks

Value: 3
public const EmailSpacing Medium #

Medium spacing - balanced spacing for most content. Value: 16px CSS equivalent: margin: 16px auto Use when: Standard content separation, default spacing

Value: 4
public const EmailSpacing Large #

Large spacing - generous breathing room. Value: 24px CSS equivalent: margin: 24px auto Use when: Section headers, important content emphasis

Value: 5
public 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

Value: 6
public 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

Value: 7
public 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

Value: 8

Extension Methods

public static String ToCssValue(EmailSpacing spacing) #
Returns: String

Converts the spacing value to a CSS px value.

Parameters

spacing HtmlForgeX.Email.EmailSpacing requiredposition: 0
Spacing option.

Returns

Pixel string representation.