Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

css - Is calc() supported in html email?

caniuse.com shows calc() can be used today in all modern browsers except Opera. But how good is the support for calc() in email clients?

Please provide a link to blogs or guides which talk about this.

EDIT
I am referring to the CSS calc() function

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

EDIT: For Css Calc(), I would say that maybe you could use it in Apple Mail or iOS native client, but even those are not likely. All others have almost no CSS3 support. See https://www.campaignmonitor.com/css/ for a pretty good list of available CSS and HTML tags in HTML email. Admittedly, this is not the Be-All list of what works in HTML emails, but as Calc() is not even listed, I would view this as a no.

EDIT2: Did a simple table html email to check results using Email On Acid and got surprising results.
https://www.emailonacid.com/app/acidtest/display/summary/hM0n3RkP89L9bfWOtXlTpQR238VwFFotgq4PkQpvBOpUf/shared

Basically looks like it works on:

Apple Mail

Outlook 2011 (apple version)

Thunderbird

Android 4 native client

iOS native

Aol (browser dependant)

Outlook.com (browser dependant)

(GMail will also accept it! - but must be inlined)

This is better then I thought, but considering, it still doesn't seem to be that elegant a solution as it fails completely in many of the popular email clients - including every webmail app (GMail app, Yahoo app, etc). It may be a viable solution depending on your audience, but in general, I would not recommend.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...