Back to Mjml

README

packages/mjml-body/README.md

5.1.01.3 KB
Original Source

mj-body

This is the starting point of your email. To aid accessibility, MJML automatically adds a div tag as the child of the body, with the following ARIA attributes role="article", aria-roledescription="email" and aria-label="EMAIL NAME", where 'EMAIL NAME' is taken from the content of the mj-title tag. The lang and dir attributes are also added here, with values taken from the mjml tag.

xml
<mjml>
  <mj-body>
    <!-- Your email goes here -->
  </mj-body>
</mjml>

Attributes

attributeacceptsdescriptiondefault value
background-colorCSS color formatsthe general background color
css-class          string  class, added to the body tag in the generated HTML.
idstringid, added to the body tag in the generated HTML
widthpxemail width600px
<p class="cta-container"><a class="cta" href="https://mjml.io/try-it-live/components/body">Try it live</a></p>