簡體   English   中英

HTML電子郵件無效:/

[英]HTML email doesn't work :/

我的HTML時事通訊有問題。 當您將代碼作為Internet網站運行時,一切都很清楚。 但是,當我將其導入Outlook時,所有CSS都不計在內。 正常嗎 謝謝

在這里發電子郵件

HTML CSS在這里

 <style> body { max-width: 600px; background-color: rgb(67, 153, 186); } h1 { color: rgb(214, 196, 0); } h2 { font-weight: bold; } * { font-family: "Univers LT 45", sans-serif; } p { background-color: rgba(255, 255, 255, 0.2) } #NewsletterPRONA { flex-direction: column; rgb(67, 153, 186); } #news {} #yellow { background-color: rgb(214, 196, 0); width: 100%; margin-bottom: auto; overflow: hidden; } #yellowL { float: left; width: 50%; } #yellowR { position: relative; float: right; width: 50%; } #h1v2 { color: rgb(67, 153, 186); background-color: rgb(214, 196, 0); } #personnel { flex-direction: column; } #qsum { background-color: rgb(214, 196, 0); overflow: hidden; } #divers { overflow: hidden; } </style> 
 <body id="NewsletterPRONA"> <div id="blue" style="background-color:rgb(67, 153, 186);"> <div id="news"> <h1>News</h1> <p></p> </div> <div id="yellow"> <h1 id="h1v2">Geschäftsverlauf / Déroulement des affaires</h1> <div id="yellowL"> <h1 id="h1v2">Offerten</h1> <p> </p> <h1 id="h1v2">Projekte</h1> <p> </p> </div> <div id="yellowR"> <h1 id="h1v2">Offres</h1> <h2>Bruit</h2> <p> </p> <h2>Sols</h2> <p> </p> <h2>Déchets</h2> <p> </p> <h2>EIE</h2> <p> </p> <h2>Physique et acoustique du bâtiment</h2> <p> </p> <h1 id="h1v2">Projets</h1> <h2>Bruit</h2> <p> </p> </div> </div> <div id="personnel"> <h1>Personal / Personnel</h1> <h2>Neueinstellungen / Nouveaux engagements</h2> <p></p> <h2>Austritte / Départs</h2> <p></p> <h2>Jubiläum / Jubilé</h2> <p></p> <h2>Geburtstage / Anniversaires</h2> <p></p> </div> <div id="qsum"> <h1 style="color: rgb(67, 153, 186);">QSUM/MQSE</h1> <div id="yellowL"> <p></p> </div> <div id="yellowR"> <p></p> </div> </div> <div id="divers"> <h1>Diverses / Divers</h1> <div id="yellowL"> <p></p> </div> <div id="yellowR"> <p></p> </div> </div> </div> </body> 

Outlook不支持背景不透明

您提供的代碼可作為網站使用(如您所說),但是不幸的是,在大多數電子郵件客戶端(不僅僅是Outlook)中,這些代碼會分崩離析。 電子郵件需要使用<table>而不是<div>進行布局。 Flexbox也無法在電子郵件中使用。

電子郵件代碼看起來像這樣:

<table cellpadding="0" cellspacing="0" border="0" align="center">
  <tr>
    <td valign="top" style="vertical-align: top;background: #aaaaaa;">
      <span style="color: #333333;">text</span>
    </td>
  </tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" align="center">
  <tr>
    <td valign="top" style="vertical-align: top;">
      <img src="full path to image" alt="alt text" width="50" height="50">
    </td>
  </tr>
</table>

如果您在使用電子郵件客戶端支持的CSS時通過將<div>替換為<table>來重建電子郵件,這應該可以解決Outlook和其他地方的顯示問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM