首頁  >  問答  >  主體

有沒有辦法在不影響 Outlook 桌面的情況下定位 Windows Mail 10 和 11?

我有一個程式碼 hack,可以在 Windows 郵件 10 和 11 之外的大多數深色模式用戶端中保留黑色背景上的白色文字。

<!--[if mso 16]> 條件語句適用於 Outlook(OL 365、OL 2021)桌面,但在 Windows Mail 10 和 11 中無法正確顯示。 Windows Mail 喜歡 <! 中使用的 css --[if !mso 16]> 條件語句區塊。是否有專門針對 Windows Mail 10 和 11 的 mso 條件代碼?

是否有其他方法可以將樣式套用到單獨的 Outlook(OL Office 365 Dark、Outlook 2021 Dark)和 Windows Mail?

<!--[if gte mso 16]>
  
    <style>
  
    .keep-white {
mso-style-textfill-type:gradient;
mso-style-textfill-fill-gradientfill-stoplist:"0 #FFFFFF 0 100000\,100000 #FFFFFF 0 100000";
color:#000000 !important;
}   

    </style>  
    
<![endif]-->
<style>
  
u + .body .gmail-screen { background:#000; mix-blend-mode:screen; }
u + .body .gmail-difference { background:#000; mix-blend-mode:difference; }
</style>
<!--[if (gte mso 9)|(IE)]>
<table align="center" cellpadding="0" cellspacing="0" border="0" style="width:640px;background-color:#000000;" role="presentation">
<tr>
<td align="center">
<![endif]-->

    <table role="presentation" style="width:100%;max-width:640px;Margin:0 auto;" cellspacing="0" cellpadding="0" bgcolor="#000000" align="center">
      <tr>
       <td class="body" style="background: linear-gradient(to bottom, #000000 0%, #000000 100%);max-width:640px;" width="100%" valign="top" align="center">
                 <!--[if gte mso 9]>
                 <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:640px;" fillcolor="#000000">
                 <v:fill type="gradient" color2="#000000"/>
                 <v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
                 <center>
                 <![endif]-->
        <table role="presentation" style="width:100%;max-width:640px;Margin:0 auto;" cellspacing="0" cellpadding="0" align="center">
             <tr>
              <td style="padding:40px 10px 40px;" align="center">
         <p style="padding:0;margin:0;font-family:'Open Sans',Helvetica, Arial,sans-serif;font-size:24px;line-height:34px;color:#ffffff;text-align:center;" class="txt16">
  <!--[if mso 16]><strong style="color:#ffffff;" class="keep-white"><![endif]-->      
  <!--[if !mso 16]><!-- --><strong style="font-weight:400;color:#ffffff;" class="gmail-screen"><span class="gmail-difference"><!--<![endif]--> 

Combo text hack. Works everywhere except Windows 10 &amp; 11 mail.

<!--[if mso 16]></strong><![endif]-->
<!--[if !mso 16]><!-- --></span></strong><!--<![endif]-->
        </p>
            </td>
           </tr>
       </table>
                 <!--[if gte mso 9]>
                 </center>
                 </v:textbox>
                 </v:rect>
                 <![endif]-->
        </td>
    </tr>
</table>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->

我套用了針對 Outlook 和 Windows Mail 10 和 11 的 <!--[if mso 16]> 條件語句,但發現 Windows Mail 深色模式處理 css 的方式與 Outlook 深色模式不同。

P粉722409996P粉722409996205 天前473

全部回覆(1)我來回復

  • P粉208286791

    P粉2082867912024-03-28 11:21:50

    Outlook 深色模式

    深色模式元標籤

    
    
    
    

    針對深色模式的 Android/Outlook.com

    
      

    可以在此處找到有關深色模式的更多資訊:

    https:// www.litmus.com/blog/the-ultimate-guide-to-dark-mode-for-email-marketers/

    #您可以使用以下兩種方法之一來定位 Windows Mail:

    /* Windows Mail (Phone & Surface) */
    _:-ms-input-placeholder, :root .your-class-name {
      /* Replace this comment with your styles */
    }

    /* Windows Mail (Phone & Surface) */
    _:-ms-fullscreen, :root .your-class-name {
      /* Replace this comment with your styles */
    }

    這兩篇文章均由 Mark Robbins 提交至 https://howtotarget.email/

    回覆
    0
  • 取消回覆