【问题标题】:HTML Email ImagesHTML 电子邮件图像
【发布时间】:2019-03-07 21:36:29
【问题描述】:

我刚刚参加了电子邮件开发人员工作的带回家考试。我的任务是尽我所能从 .png 文件中创建 HTML 电子邮件。我一直在使用表格,我来到了一个必须在文本旁边插入图像的部分,我崩溃了。标题文本与段落相距太远,图像位置不佳;有没有人对如何解决这个问题有任何想法?我的代码如下:

       
div #costume-section {
    
    width:645px;
    height: 225px;
    padding-left: 05px;
    background: #ff821d;
    color: white;    
           
}
 <div id="costume-section">
         <table>
             <th id="cos-font">Costume Contest</th>
             <tr>
               <td>Duhh, of course - Wear it all day if you wanna. Perhaps you will be the winner of the contest? (must be present at party to be voted on)  We'll hold a kid contest too!</td>
                 <td><img src="http://mandrill-emails.s3.amazonaws.com/melt-holidays/20151020/costumes.png"  /></td>
             </tr>
         </table>
     </div>

【问题讨论】:

  • 由于这是一个求职面试问题,我强烈建议您尝试自己完全解决这个问题。如果您为此苦苦挣扎,那么也许这份工作不适合您。
  • 有人建议我在需要时“寻求帮助”,并告诉他们知道“在哪里”寻求帮助对他们来说与我真正知道如何编写代码。

标签: html email html-email


【解决方案1】:

? 雷切尔德夫

像处理电子表格一样思考这个问题。您已设置 thtr 表格行。

由于您的标题文本位于包含 2 个 td 的行之外,因此标题文本位于包含文本和图像的 tr 之上。

在这种情况下,您实际上并不需要 th 重新排列表格标记,除非它是必需的。

 <div id="costume-section">
         <table>
             <tr>
               <td>
               <h1>Costume Contest</h1>
               Duhh, of course - Wear it all day if you wanna. Perhaps you will be the winner of the contest? (must be present at party to be voted on)  We'll hold a kid contest too!</td>
                 
                 <td><img src="http://mandrill-emails.s3.amazonaws.com/melt-holidays/20151020/costumes.png"  /></td>
             </tr>
         </table>
     </div>

【讨论】:

  • 将其视为电子表格的部分确实帮助我更好地可视化了这个概念。非常感谢!
猜你喜欢
  • 2012-01-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-08-01
  • 2011-10-06
  • 2011-05-16
相关资源
最近更新 更多