README.md
May 26, 2026 ยท View on GitHub
mj-attributes
Inside the mj-attributes tag, you can cite other MJML components, like mj-text for example, to override the default settings for that component.
An mj-all tag is like the above, but affects all MJML components.
An mj-class tag creates a named group of MJML attributes you can apply to MJML
components using mj-class="<name>".
<mjml>
<mj-head>
<mj-attributes>
<mj-text padding="0" />
<mj-class name="blue" color="blue" />
<mj-class name="big" font-size="20px" />
<mj-all font-family="Arial" />
</mj-attributes>
</mj-head>
<mj-body>
<mj-section>
<mj-column>
<mj-text mj-class="blue big">
Hello World!
</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
Important
MJML will apply found attributes in the following order:
- inline attributes within tags,
- attributes found in tags within the
mj-attributestag, e.g.mj-text, - the
mj-alltag withinmj-attributes, and - the default MJML values.