Mjml: Request mj-container can be more than 600px??

Created on 30 Aug 2016  路  4Comments  路  Source: mjmlio/mjml

Hi folks,

I wanna use mjml on my responsive email template, but i need the width of mj-container will be over 600px exactly 650px :) any hint to do it?

Thanks

Most helpful comment

You can set the container width on either the container itself or declare the width in the attributes as below.

<mjml>
    <mj-head>
    <mj-title>Email Title</mj-title>
        <mj-attributes>
            <mj-container width="650px" />
        </mj-attributes>
    </mj-head>
    <mj-body>
        <mj-container>
            <mj-section>
                <mj-column>
                                        <!-- Content -->
                                </mj-column>
            </mj-section>
        </mj-container>
    </mj-body>
</mjml>

I tend to use these resets in the attributes too

<mj-all padding="0" font-family="Arial" />
<mj-column align="center" vertical-align="middle" />

All 4 comments

You can set the container width on either the container itself or declare the width in the attributes as below.

<mjml>
    <mj-head>
    <mj-title>Email Title</mj-title>
        <mj-attributes>
            <mj-container width="650px" />
        </mj-attributes>
    </mj-head>
    <mj-body>
        <mj-container>
            <mj-section>
                <mj-column>
                                        <!-- Content -->
                                </mj-column>
            </mj-section>
        </mj-container>
    </mj-body>
</mjml>

I tend to use these resets in the attributes too

<mj-all padding="0" font-family="Arial" />
<mj-column align="center" vertical-align="middle" />

I only edited your answer to add indention + syntax highlight but @dalefish is totally right ! 馃憤

Thanks @iRyusa, it was a hasty reply, much appreciated.

For future reference, in MJML v4 mj-container is replaced by mj-body so you'd need to do:

<mj-container width="650px" />
Was this page helpful?
0 / 5 - 0 ratings

Related issues

csmcanarney picture csmcanarney  路  3Comments

iwanaga-sakura picture iwanaga-sakura  路  4Comments

samatcd picture samatcd  路  4Comments

fmauNeko picture fmauNeko  路  3Comments

karanmartian picture karanmartian  路  3Comments