2
我正在尋找一種基於客戶打開電子郵件的設備顯示/隱藏電子郵件通訊的內容的方法。如何根據設備顯示/隱藏內容
我目前有此代碼段中頭部分:
@media only screen and (max-width: 480px) {
#mobile { display: block; } /* show it on small screens */
#normal { display: none; } /* hide it elsewhere */
}
@media only screen and (min-width: 481px) {
#mobile { display: none; } /* hide it elsewhere */
#normal { display: block; } /* show it on large screens */
}
隨着:
<div id="mobile">content</div> or <div id="normal">content1<div>
,如果我使用它的網絡也能正常工作,我可以擴展我的瀏覽器窗口和內容根據窗口寬度顯示/消失,但只要我通過電子郵件系統發送測試,它就可以在移動設備上正常工作,但在桌面設備(Gmail)上會出現故障。
而且,因爲這是一封電子郵件,我無法使用JavaScript,因此它都需要爲html/css。
任何我做錯了或失蹤?
值得注意的是,許多電子郵件客戶端都具有非常原始的HTML和CSS支持,因此在某些客戶端上實際上可能無法實現。對不起,我不能幫助更多。 – surfitscrollit 2013-02-21 15:33:29
這裏有一些關於Gmail支持哪些標準的信息:http://www.email-standards.org/clients/gmail/和http://www.campaignmonitor.com/css/ – surfitscrollit 2013-02-21 15:34:09