检查设备是否是HTML电子邮件中的iOS [英] Check if a device is iOS inside an HTML email

查看:111
本文介绍了检查设备是否是HTML电子邮件中的iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在HTML电子邮件中检查设备是否为iOS?

Is it possible to check if a device is iOS inside an HTML email?

我想显示本地应用程序的Apple和Google地图架构链接,但仅限于如果设备支持它。

I want to display Apple and Google maps schema links to the native apps, but only if the device supports it.

推荐答案

看了网上,甚至找不到CSS的黑客攻击。遗憾的是,没有相当于<! - [if gte mso 9]> 标签。看起来答案在技术上是没有......

Had a look online and couldn't even find a hack in CSS. Shame there is no equivalent to the <!--[if gte mso 9]> tags. It looks like the answer is technically no...

在这种情况下,好的是Mac对其他客户端有不同的CSS支持,所以你可以把它作为一项工作在电子邮件中。

Good thing in this case is that Mac has different CSS support to other clients, so you can leverage that as a work around in email.

尝试使用其中一个CSS选择器(例如第N个孩子)。这些是只有mac识别的CSS属性

Try using one of the CSS selectors (Nth child for example). These are CSS attributes that only mac recognizes.

从理论上讲,你可以默认隐藏一些东西,并设置第N个子选择器来显示仅限Mac的内容。

Theoretically you could hide something by default and set the Nth child selector to show the Mac only content.

如果你真的是在吸气,你还可以在同一颜色的背景上使用RGBA或HSLA颜色显示一些仅mac文本(使其不可见)。

If you were really despirate, you could also display some 'mac only' text using RGBA or HSLA colors on the same color background (making it invisible).

这篇关于检查设备是否是HTML电子邮件中的iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆