簡體   English   中英

當 Android Gmail 應用程序的電子郵件堆棧中包含全寬圖像時,為什么左對齊表格?

[英]Why do left-aligned tables in an email stack on the Android Gmail App when they contain full width images?

我知道 Android Gmail 應用程序不允許媒體查詢,因此應該顯示電子郵件的桌面版本。

在大多數情況下它確實如此,但是有一個部分應該並排放置,並且出於某種原因在 Android Gmail 應用程序上,它會堆疊,這似乎是由於圖像與表格的寬度相同,因為如果每個左對齊表格中只有文本,它就可以正常工作。 我想知道是否有其他人遇到過這個問題並找到了解決方案?

到目前為止,我遇到的唯一解決方案是減小圖像的寬度,然后在圖像右側留下一個間隙。

代碼如下:

<table class="mobile_wrapper" bgcolor="#000000" border="0" width="640" cellpadding="0" cellspacing="0" style="background-color:#000000; width:640px;">
                <tr>
                  <td>    
                    <table align="left" class="mobile_wrapper" bgcolor="#000000" border="0" width="320" cellpadding="0" cellspacing="0" style="background-color:#000000;width:320px;"> 
                        <tr>
                          <td>
                            <img src="https://placehold.it/320x389" alt="image" width="100%" height="389" border="0" align="top" class="mobile_image" style="display:block;" /> 
                         </td>
                       </tr>  
                   </table>
                  <table align="left" class="mobile_wrapper" bgcolor="#000000" border="0" width="50%" cellpadding="0" cellspacing="0" style="background-color:#000000;width:320px;"> 
                       <tr>
                         <td>
                           <img src="https://placehold.it/320x389" alt="image" width="100%" height="389" border="0" align="top" class="mobile_image" style="display:block;" />
                         </td>
                       </tr>
                 </table>
               </td>
             </tr>
</table>

我不確定為什么這被否決了 - 但對於其他有這個問題的人來說,這實際上是一個簡單的修復 - 我認為這與 Gmail 的自動調整大小有關。

繞過它的方法是確保圖像在具有固定寬度的表格中具有 100% 的寬度 - 這樣如果表格縮小 - 圖像也會隨之縮小。 我幾乎擁有它 - 但由於某種原因,第二個左對齊表格的寬度為 50%。

暫無
暫無

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

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