2014-11-03 46 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