Search code examples
htmlnewsletter

Emailing, how to move a div, without using padding, margin, right, left etc


Need to make an HTML newsletter.

The problem is, I want to move a div on another, which is possible to do with margin, or position: x; and top: x; left:x; but on an email, this doesn't work. Do you have any solution ? Thanks a lot.


Solution

  • I don't have a solution, just some advice... Don't try to do that. It will not work (for a lot of clients). Go back in time and channel your HTML 4.0.1 days, forget CSS classes exist and write your markup like it's the early 2000's again....

    This means:

    • Inline everything related to styling (likely with a lot of repetition)
    • https://www.campaignmonitor.com/css/ bookmark this, you'll need it (a lot)
    • <table> and related are now your new best friends
    • Think outside the box because most fancy scenarios that require complex CSS or JS can easily be "faked" with tables and a tiny bit of styling

    Do try this:

    Rely on your creative smarts and available documentation to come up with something that looks like what you want, but actually isn't.

    I.e. your question: "how to position div on div" could require you to use a table with a table in it that will create the illusion of stacked content while it isn't (think back to the days of slicing images into tiny parts to set as table backgrounds for instance).