2014-11-03 89 views
2

我创建了一个响应式HTML电子邮件,它可以在许多不同的平台上正常工作,除非在iPhone上查看。从HTML电子邮件中删除日期/时间样式iPhone

看来,iOS正在识别日期+时间并对内容应用蓝色/下划线。我在过去的几个小时研究了这个问题,并且处于死胡同。

我试图打开格式检测关闭电话号码:

<meta name="format-detection" content="telephone=no"> 

我试过,包括这也dateaddress

<meta name="format-detection" content="telephone=no, date=no, address=no"> 

我已经尝试添加!important到元素上的款式依然没有运气:

<h4 style="font-size: 16px;color: #FFFFFF !important; text-decoration:none !important;font-family: Arial;font-weight: bold;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;" class="appleLinksWhite"> 
    Thursday 20th November 
</h4> 

<p style="color: #FFFFFF !important; text-decoration:none !important;margin: 0;margin-bottom: 0;font-family: Arial;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px !important;" class="appleLinksWhite"> 
    10:45am until 12:30pm,<br>The Feast, Suffolk Food Hall, Ipswich 
</p> 

我已经尝试在元素.appleLinksWhite中添加一个类,建议使用here,但仍不能解决问题。

我也尝试用<span>包装内部内容与颜色和文字装饰集,这仍然无法正常工作。

我不知道要尝试其他事情。我如何禁用此行为?

编辑*值得注意的是,这个问题仅限于iPhone 4/5。 iPhone 6/Plus很好。

回答

2

我设法欺骗日期检测算法得到这个工作,以为它是不是由我的日期/时间字符串之间插入一个零宽度&#8203;字符处理日期如:

<h4 style="font-size: 16px;color: #FFFFFF !important; text-decoration:none !important;font-family: Arial;font-weight: bold;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;" class="appleLinksWhite"> 
    Thursday&#8203; 20th&#8203; November&#8203; 
</h4> 

<p style="color: #FFFFFF !important; text-decoration:none !important;margin: 0;margin-bottom: 0;font-family: Arial;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px !important;" class="appleLinksWhite"> 
    10:45am&#8203; until&#8203; 12:30pm&#8203;,<br>The Feast, Suffolk Food Hall, Ipswich 
</p> 
7

这将消除蓝色+下划线造型(在iPhone 5,iOS 8.3上测试):

a[href^="x-apple-data-detectors:"] { 
    color: inherit; 
    text-decoration: inherit; 
} 
+1

This Works!我确实必须使样式变得重要,并且省略:使其起作用:[color = #fbf]“color = text-decoration:inherit!important; } *谢谢*,@Christian。 – 2016-01-25 22:46:03