This might offer a workable solution from 6 years ago.
(my search string is “html email vs line-height”)
What I’m seeing is that outlook needs % heights
Outlook supports line-height specified in percents. For example line-height: 1.1 isn’t supported, but line-height: 110% is.
In post #12 I notice that @javascript7 is using line-height: .8;
Try it with line-height: 80%;
Thank you for that but by using px the look you get in html is the same look on the Samsung cell phone and in Outlook it does display but the spacing is way off.
One of the respondents in Stack Overflow suggested percent line heights, as Ray.H acknowledged. Have you tried that, yet?
Thanks for pointing that out. I was looking at pixels instead. So I did try it out and it does display to the page. The spacing is not the same, but it’s close. 70% seems to be the best compromise. Interesting through, when you look at the html web version, the top and bottom letters are close to merging. So it’s different for all 3.
When the line height was .8, it looked the same in html and in the email provided with wasn’t outlook.
Thanks for your follow up, I appreciate it.
Welcome to the world of html email
I’ve yet to find 2 email clients that display a page the same way so everything is a compromise.
Avoid display and margins and use table cells to place everything into place using inline styles. I’m not surprised line-height isn’t working properly as the email client probably wanted to control that explicitly for its own purposes.
Sometimes you can give a height to the element to cut off the spacing on large fonts. Remember that font of 80px is going to have a half-leading top and bottom (basically white space) and that reducing the line height to less than one is probably something email clients won’t want to do easily.
A lot of old email clients (of which outlook is a throwback) do not honour the display property (or margins) and an inline element is always an inline element.
You have to throw away everything you ever thought was true when coding html emails It’s such a pain that I no longer do them for clients and tell them to get a free one from campaign monitor or similar
That you for your words of wisdom, I appreciate that. I suppose, based on your comments, you prefer plain text emails over html emails - less can go wrong - just keep it simple?
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.