Search code examples
htmlcssemailnewsletter

newsletter css acts weird when sent in mail


I'm supposed to make a newsletter for a client (my very first newsletter). In html it's perfect and when I open it in a webbrowser it's also the way it's supposed to be. I first had the issue of the CSS not showing at all (I had the css in the head of my html code), then I found out about the 'Inliner Tool' on mailchimp. After I did that, my css finally was sent with my mail but not everything is in the right position and I don't really know what to do right now.

My pictures are placed as backgroundimages in divs. Each Div has a size in px, only the background image size is in percents.

Since I'm new here I don't really know how to put my code in my question, so I'm just going to ask you all: Has anyone had the same issue and how did you solve it? I hope I gave enough information

UPDATE: Thank you for telling me about JSFiddle. I can't put a link in here (sorry), still pretty new to this lol. But you can go to jsfiddle . net and add pht3rnet to look into my code. (in the results, it's exactly how it's supposed to be.)


Solution

  • If you want to support the majority of the email clients out there you have to understand that there are restrictions on the CSS styles you can use. You can take a look at this table that will show you if a CSS property is supported by a specific email client: https://www.campaignmonitor.com/css/

    For example the property background-image is not supported by Outlook 2007+ so your image won't show up if opened from Outlook.