How do I get MS Outlook to accept the CSS style display:block?

前端 未结 3 997
轻奢々
轻奢々 2021-02-18 16:40

I am composing an HTML email using a service (MailChimp). The way that MailChimp marks up headings is to use a SPAN tag and gives the tag the inline style of

3条回答
  •  不要未来只要你来
    2021-02-18 16:42

    I found myself in this exact situation: needing to create header styles that displayed correctly in outlook without the ability to edit the HTML because I'm handing the template off to a client.

    I imagine you've already solved this, but to anyone else who spent several hours trying to answer this question and stumbles across this thread, here's how I fixed it:

    1. Delete Mailchimp's default H1, H2, etc.

    2. Create your own header styles (I named them Header, Sub-Header, etc. just to avoid confusion)

    3. Use the new header styles as you wish. The new headings display as blocks.

    I'm not exactly sure what's going on under the hood as I can't inspect in Outlook, but my guess is that by not using the default styles either Mailchimp wraps the header text in divs instead of spans.

提交回复
热议问题