README.md

February 3, 2026 ยท View on GitHub

mj-section

Sections are rows within your email. They will be used to structure the layout.

<mjml>
  <mj-body>
    <mj-section full-width="full-width" background-color="red">
      <!-- Your columns go here -->
    </mj-section>
  </mj-body>
</mjml>

The full-width attribute will be used to manage the background width. Setting it will change the width of the section from the default 600px to 100%.

Attributes

attributeacceptsdescriptiondefault value
background-colorCSS color formatssection color
background-positionstringCSS values, i.e. left center right + top center bottom
(see outlook limitations below)
top center
background-position-xstringCSS values, i.e. left center right
(see outlook limitations below)
background-position-ystringCSS values, i.e. top center bottom
(see outlook limitations below)
background-repeatrepeat no-repeatset the background image to repeat
background-sizestringCSS values e.g. auto cover contain px % sizeauto
background-urlstringbackground image, in URL format
borderstringCSS border format
border-bottomstringCSS border format
border-leftstringCSS border format
border-radiusstringborder radius
border-rightstringCSS border format
border-topstringCSS border format
css-classstringclass name, added to the root HTML element created
directionltr rtlset the display order of direct childrenltr
full-widthfull-width falsemake the section full-width
paddingpx %section padding, supports up to 4 parameters20px 0
padding-bottompx %section bottom padding
padding-leftpx %section left padding
padding-rightpx %section right padding
padding-toppx %section top padding
text-alignleft center rightCSS text-aligncenter

Try it live