Home Forums Newsletter Plugin Support Integrate additional CSS into newsletters

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #352480
    User
    Participant

    Hello Community,

    I want to create multiple columns within an HTML section. For this, I need additional CSS code. How can I add extra CSS code to my newsletter?

    #352637
    Michael
    Keymaster

    Hello,

    email design, expecially when it comes to structure, doesn’t rely much on css. If you’re using the html block, multiple columns structure can be obtained using nested tables. No css is needed.

    Michael

    #352659
    User
    Participant

    Hello Michael,

    I’ve already tried many things, for example, a table with two columns. However, in the mobile view, this caused the frame to extend to the right, creating a scroll bar. Could you please post an example of your solution?

    Adrian

    #352773
    Michael
    Keymaster

    Hello Adrian,

    if the frame exceeded the email container, you’ve probably misconfigured some widths. Here’s a basic template you can start with:

    https://pastebin.com/af72aPw8

    Let me know if that works for you.

    Michael

    #352779
    User
    Participant

    Hello Michael,

    thanks for your suggestion, but that’s still not the solution… The issue is that the fields should displayed side-by-side in the desktop view, but as soon as the resolution gets too low, the fields should be displayed one below the other. As far as I know, this only works with a DIV tag and CSS. If you know a HTML solution for this, that would be great, because a snippet like that is always useful…

    … it would also super to have a function “additional CSS” in thenewsletterplugin.

    #352810
    Michael
    Keymaster

    Hello Adrian,

    unfortunately CSS in email design doesn’t work like in regular web pages. There have been many progresses in the last few years but we’re still facing incompatibilities with many email clients so we cannot introduce any of the newer techniques for all our users.

    If you’re using our visual composer, it should be fairly easy to obtain a 2 colums layout, but if you’re coding your own html section it would be better to think of a hybrid design. That would be:

    1. You create your template with the dynamic blocks from our composer, e.g. posts,
    2. You save it and switch to html editor (warning: you will not be able to switch back)
    3. You create your desired 2 columns section with html, you can start with this article which explains the ropes of responsive email design https://www.litmus.com/blog/understanding-responsive-and-hybrid-email-design
    4. Save it again and test.

    Unfortunately we cannot give much support on custom designs, other people may be helpful here in the forums.

    Michael

    #352819
    User
    Participant

    Hello Michael,

    I’ve found a suitable solution that integrates the CSS into the HTML tags and worked very well 🤓. Here’s my solution (this source code can be inserted into an HTML block):

    <div style=”display: flex; flex-wrap: wrap; gap: 10px;”>
    <div style=”flex: 1 1 200px; background: #eee; padding: 15px;”>
    <h3>Column 1</h3>
    <p>Contents of the first column.</p>
    </div>
    <div style=”flex: 1 1 200px; background: #ddd; padding: 15px;”>
    <h3>Column 2</h3>
    <p>Contents of the second column.</p>
    </div>
    </div>

    #352852
    Michael
    Keymaster

    Hello Adrian,

    that will never work on an email client. Please re-read my last reply. Use this website to check which html and css work in an email and which doesn’t.

    Michael

    #352862
    User
    Participant

    But it works 🤷‍♂️

    …after I’d sent it via thenewsletterplugin, it is displayed side by side in the desktop view (Thunderbird) and one below the other on my smartphone… just test it 😎

    #352921
    Michael
    Keymaster

    Sorry, I forgot the url.

    Here is it: caniemail.com. Search for “flex” and you’ll see why it’s not a great idea to use it in an email.

    Michael

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.