Mjml: Need a little help with mjml to html !

Created on 29 Jul 2016  路  5Comments  路  Source: mjmlio/mjml

Hello all,

I apologize, this is nor a bug report nor an enhancement. But I'm hoping if I get replies that these can help out other people! I'm trying to re-create this with mjml:
image

So I've created a mjml-divider and the box but they are too far apart, my markup produces this:

image

I'm looking for hints to bring these together. Here is my code:

  <mj-section>
    <mj-column>
      <mj-divider border-width="2px" border-style="solid" border-color="#00aeef" padding-bottom="0" padding-top="0" />
    </mj-column>
  </mj-section>

  <mj-section>
    <mj-column>
      <mj-text padding-bottom="0" padding-top="0" align="center">
        <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td bgcolor="#00aeef" style="text-transform:uppercase; color:#ffffff; font-family:Arial, Helvetica, sans-serif; font-size: 18px; line-height:18px; padding: 10px 12px; ">discover</td>
          </tr>
        </table>
      </mj-text>
    </mj-column>
  </mj-section>

Any help appreciated, if it's not the proper place to ask this please forgive me and kindly suggest another place.

Thanks!

Thomas

Discussion

Most helpful comment

Tested this, it works.

 <mj-section padding-bottom="0" padding-top="0">
    <mj-column>
      <mj-divider border-width="2px" border-style="solid" border-color="#00aeef" padding-bottom="0" padding-top="0" />
    </mj-column>
  </mj-section>

  <mj-section padding-bottom="0" padding-top="0">
    <mj-column>
      <mj-text align="center" padding-bottom="0" padding-top="0">
        <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td bgcolor="#00aeef" style="text-transform:uppercase; color:#ffffff; font-family:Arial, Helvetica, sans-serif; font-size: 18px; line-height:18px; padding: 10px 12px; ">discover</td>
          </tr>
        </table>
      </mj-text>
    </mj-column>
  </mj-section>

I personally use a reset before I start so I know where I am:

<mj-head> <mj-attributes> <mj-all padding="0"> </mj-attributes> </mj-head>

All 5 comments

Take the top/bottom padding off the sections, might also need vertical alignment on the discover element

Thanks @dalefish, tried that but it didn't do the trick.

Tested this, it works.

 <mj-section padding-bottom="0" padding-top="0">
    <mj-column>
      <mj-divider border-width="2px" border-style="solid" border-color="#00aeef" padding-bottom="0" padding-top="0" />
    </mj-column>
  </mj-section>

  <mj-section padding-bottom="0" padding-top="0">
    <mj-column>
      <mj-text align="center" padding-bottom="0" padding-top="0">
        <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td bgcolor="#00aeef" style="text-transform:uppercase; color:#ffffff; font-family:Arial, Helvetica, sans-serif; font-size: 18px; line-height:18px; padding: 10px 12px; ">discover</td>
          </tr>
        </table>
      </mj-text>
    </mj-column>
  </mj-section>

I personally use a reset before I start so I know where I am:

<mj-head> <mj-attributes> <mj-all padding="0"> </mj-attributes> </mj-head>

Thanks @dalefish, I had misunderstood what you meant by "take off the padding from the sections". Appreciate your patient help! :)

I believe the issue is fixed so I'm closing @uscsnostromo, feel free to reopen if it's not.

Big thanks to @dalefish for his help!

Was this page helpful?
0 / 5 - 0 ratings