This skill should be used when the user asks about MJML syntax, components, or attributes, when writing or editing MJML email templates, when creating responsive email layouts, when troubleshooting...
MJML (Mailjet Markup Language) is a markup language designed to reduce the pain of coding responsive emails. It compiles to responsive HTML that works across email clients.
Every MJML document follows this hierarchy:
<mjml>
<mj-head>
<!-- Head components: styles, fonts, attributes, preview text -->
</mj-head>
<mj-body>
<!-- Body components: sections, columns, content -->
</mj-body>
</mjml>
MJML enforces a strict nesting structure:
mjml
āāā mj-head
ā āāā mj-attributes (define defaults and classes)
ā āāā mj-style (CSS styles)
ā āāā mj-font (external fonts)
ā āāā mj-title (document title)
ā āāā mj-preview (inbox preview text)
ā āāā mj-breakpoint (responsive breakpoint)
ā
āāā mj-body
āāā mj-wrapper (optional: wraps multiple sections)
ā āāā mj-section
ā
āāā mj-section (rows)
āāā mj-group (prevents column stacking on mobile)
ā āāā mj-column
ā
āāā mj-column (responsive columns)
āāā mj-text
āāā mj-image
āāā mj-button
āāā mj-divider
āāā mj-spacer
āāā mj-social
āāā mj-navbar
āāā mj-table
āāā mj-raw
āāā mj-accordion
āāā mj-carousel
āāā mj-hero
Critical rule: Content blocks (text, image, button, etc.) must always be inside mj-column. Columns must be inside mj-section or mj-group.
By default, columns divide available width equally. Standard email width is 600px:
Override with explicit width attribute:
<mj-section>
<mj-column width="33%"><!-- Narrow --></mj-column>
<mj-column width="67%"><!-- Wide --></mj-column>
</mj-section>
Both pixel and percentage values are supported.
Most components support these attributes:
| Attribute | Description | Example |
|---|---|---|
padding |
Spacing inside element | 10px 25px |
background-color |
Background color | #ffffff |
width |
Element width | 100% or 300px |
align |
Horizontal alignment | left, center, right |
vertical-align |
Vertical alignment | top, middle, bottom |
font-family |
Text font | Arial, sans-serif |
font-size |
Text size | 14px |
color |
Text color | #333333 |
line-height |
Line spacing | 1.5 or 22px |
Define reusable styles with mj-class:
<mj-head>
<mj-attributes>
<mj-class name="primary" background-color="#4A90D9" color="#ffffff" />
<mj-class name="heading" font-size="24px" font-weight="bold" />
</mj-attributes>
</mj-head>
<mj-body>
<mj-section>
<mj-column>
<mj-button mj-class="primary">Click me</mj-button>
<mj-text mj-class="heading">Welcome</mj-text>
</mj-column>
</mj-section>
</mj-body>
Sections and wrappers support background images:
<mj-section background-url="https://example.com/bg.jpg"
background-size="cover"
background-repeat="no-repeat">
<mj-column>
<mj-text color="#ffffff">Content over image</mj-text>
</mj-column>
</mj-section>
By default, sections are constrained to 600px. Use full-width for edge-to-edge backgrounds:
<mj-section full-width="full-width" background-color="#f4f4f4">
<!-- Content still constrained, but background extends full width -->
</mj-section>
mj-group to prevent stacking for specific column groupsmj-breakpointFor complete component specifications with all attributes:
${CLAUDE_SKILL_ROOT}/references/body-components.md${CLAUDE_SKILL_ROOT}/references/head-components.md${CLAUDE_SKILL_ROOT}/references/patterns.md