MJML edm如何使列的高度与另一列相同?

时间:2017-07-27 06:54:19

标签: email html-email mjml

我正在尝试在我的EDM上实现以下设计:

enter image description here

我尝试了以下内容:

<mj-section
    padding="12px 48px 12px"
    background-color="#FFF"
>

    <mj-column width="50%">
        <mj-image
            src="assets/img/image-1.png"
            width="231px"
            padding="0"
            align="center"
        />
    </mj-column>

    <mj-column width="50%" background-color="#F0F0F0">
        <mj-text
            color="#101010"
            font-size="29px"
            line-height="35px"
            font-family="Arial, sans-serif"
            font-weight="700"
            align="right"
            padding="0"
        >
        <p>Lorem ipsum dolor sit amet</p>
        </mj-text>
    </mj-column>

</mj-section>

但是我得到的不是我想要的结果:

enter image description here

如何让第二列的高度填充整个部分以等于另一列的高度?

希望有人能提供帮助,谢谢!

1 个答案:

答案 0 :(得分:3)

您可以为整行(或两列)提供相同的背景颜色

<mj-section
padding="12px 48px 12px"
background-color="#fff">

<mj-section
background-color="#F0F0F0">

<mj-column width="50%" background-color="#F0F0F0">
    <mj-image
        src="assets/img/image-1.png"
        width="231px"
        padding="0"
        align="center"/>
</mj-column>

<mj-column width="50%" background-color="#F0F0F0">
    <mj-text
        color="#101010"
        font-size="29px"
        line-height="35px"
        font-family="Arial, sans-serif"
        font-weight="700"
        align="right"
        padding="0"
    >
    <p>Lorem ipsum dolor sit amet</p>
    </mj-text>
</mj-column>
</mj-section>
</mj-section>

如果有效,请告诉我。