HTML中的边框底部未显示

时间:2018-04-18 19:33:43

标签: html css vb.net email

我正在尝试使用VB.Net上的HTML设计发送电子邮件,但边框底部没有显示,我也没有看到代码有任何问题。

您可以在此处看到边框底部未显示:

enter image description here

预期的边框底部应该是这样的,底部有一条灰色的线条:

enter image description here

这是我的边框底部代码:

                    mm.Body = mm.Body & "<tbody><tr>"
                    mm.Body = mm.Body & "<td style=min-height:65px;background-color:#000000;border-bottom:1px solid #4d4b48;>"
                    mm.Body = mm.Body & "<img src=https://image.ibb.co/gf2547/Email_Header_PNG.png width=538 height=65 alt=Steam>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"

您可以在此处查看整个电子邮件的完整HTML代码:

                    mm.Body = mm.Body & "<div>"
                    mm.Body = mm.Body & "<table style=width:538px;background-color:#393836; align=center cellspacing=0 cellpadding=0>"


                    mm.Body = mm.Body & "<tbody><tr>"
                    mm.Body = mm.Body & "<td style=min-height:65px;background-color:#000000;border-bottom:1px solid #4d4b48;>"
                    mm.Body = mm.Body & "<img src=https://image.ibb.co/gf2547/Email_Header_PNG.png width=538 height=65 alt=Steam>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"


                    mm.Body = mm.Body & "<tr>"
                    mm.Body = mm.Body & "<td bgcolor=#370E0E>"
                    mm.Body = mm.Body & "<table width=470 border=0 align=center cellpadding=0 cellspacing=0 style=padding-left:5px;padding-right:5px;padding-bottom:10px;>"
                    mm.Body = mm.Body & "<tbody><tr bgcolor=#370E0E>"
                    mm.Body = mm.Body & "<td style=padding-top:32px;>"
                    mm.Body = mm.Body & "<font color=#F12121> <h1> Dear " + firstname + " " + lastname + ", </h1> </font>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "<tr>"
                    mm.Body = mm.Body & "<td style=padding-top:12px;>"
                    mm.Body = mm.Body & "<font color=#c6d4df> <h3> The Newly Generated Password you need to login into your account is : </h3> </font>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "<tr>"
                    mm.Body = mm.Body & "<td>"
                    mm.Body = mm.Body & "<div>"
                    mm.Body = mm.Body & "<font color=#F12121> <h1> " + lbl1.Text + " </h1> </font>"
                    mm.Body = mm.Body & "</div>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "<tr bgcolor=#2A0808>"
                    mm.Body = mm.Body & "<td style=padding:20px;font-size:12px;line-height:17px;color:#c6d4df; font-family:Arial, Helvetica, sans-serif;>"
                    mm.Body = mm.Body & "<p style=padding-bottom:10px;color:#c6d4df;>This Email and Password was generated upon your request. The Verification Attempt included your correct Umbrella ID and Email.</p>"
                    mm.Body = mm.Body & "<p style=padding-bottom:10px;color:#c6d4df;>The Generated Password is required to complete the login.  <span style=color:#ffffff;font-weight:bold;>No one can access your account without also accessing this email.</span></p>"
                    mm.Body = mm.Body & "<p style=padding-bottom:10px;color:#c6d4df;><span style=color:#ffffff;font-weight:bold;>If you are not attempting to login</span> then please change your Umbrella Account password and consider changing your email password as well to ensure your account security.</p>"
                    mm.Body = mm.Body & "<p style=padding-top:10px;color:#61696d;>If you are unable to access your account then you may choose to <a rel=nofollow style=color:#8f98a0; target=_blank href=https://help.steampowered.com/#HelpUnauthorizedLogin?stoken=PbSXLaCZRzquMH0O2wIxCSPQlkzzZ%2BYDb0OWGxQEIhILTU1sRh69ojyLplpI6nFD8cPAAi0E59y0hViMAOj9ekVlQX0ekbDB0fKFEYzrO1M%3D> lock your account.</"
                    mm.Body = mm.Body & "a> Once locked you must request <a rel=nofollow style=color:#8f98a0; target=_blank href=https://support.steampowered.com/newticket.php?category=11> Umbrella Support's Assistance </"
                    mm.Body = mm.Body & "a> in recovering and unlocking it.  Until the account is unlocked you will be restricted from accessing any of the Umbrella Corporation's Property and will be held in Solitary Confinement.</p>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "<tr>"
                    mm.Body = mm.Body & "<td style=font-size:12px;color:#6d7880;padding-top:16px;padding-bottom:60px;>"
                    mm.Body = mm.Body & "Umbrella Corporation Personnel Security Observation Team<br>"
                    mm.Body = mm.Body & "<a rel=nofollow style=color:#8f98a0; target=_blank href=https://help.steampowered.com/>https://support.umbrellacorp.uc </a><br>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "</tbody></table>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "<tr style=background-color:#000000;>"
                    mm.Body = mm.Body & "<td style=padding:12px 24px;>"
                    mm.Body = mm.Body & "<table cellpadding=0 cellspacing=0>"
                    mm.Body = mm.Body & "<tbody><tr>"
                    mm.Body = mm.Body & "<td width=92>"
                    mm.Body = mm.Body & "<img src=https://image.ibb.co/krMnHS/Email_Footer_2_PNG.png width=92 height=26 alt=Valve®>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "<td style=font-size:11px;color:#595959;padding-left:12px;>Umbrella Corporation. PO Box 1688 Bellevue, WA 98009.<br> "
                    mm.Body = mm.Body & "All rights reserved. All trademarks are property of their respective owners in the US and other countries. <br>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "</tbody></table>"
                    mm.Body = mm.Body & "</td>"
                    mm.Body = mm.Body & "</tr>"
                    mm.Body = mm.Body & "</tbody></table>"
                    mm.Body = mm.Body & "</div>"

3 个答案:

答案 0 :(得分:2)

您需要在标记中的属性值周围加上引号,例如:

mm.Body = mm.Body & "<td style=""min-height:65px;background-color:#000000;border-bottom:1px solid #4d4b48;"">"

对代码中的所有其他属性重复此操作,style或其他。

如果没有引号,你的HTML标记就会无效,而且最好解析HTML标记的任何内容都会在看到第一个无效的属性值字符后放弃(可能是-:这种情况)导致整个style属性基本上被忽略。

鉴于电子邮件HTML已经非常挑剔,您应该确保您的标记尽可能有效。

最后,为了可维护性,我建议以某种方式使用可替换的令牌或其他东西存储HTML,并在VB.NET代码中替换它们。逐行拼接标记并不能帮助识别标记中的错误,例如缺少结束标记。它还可以防止您更改布局而无需重新编译代码。

答案 1 :(得分:0)

您的手机高度比图像+边框短。在td上尝试最小高度为67px,或者将img高度设为63像素(至少要测试)。

如果不起作用,请尝试使用td上的1px填充。

答案 2 :(得分:0)

您确定<tbody>标记位于<table>标记内吗?

    <table>
      <tr>
        <td >
          <img src=https://image.ibb.co/gf2547/Email_Header_PNG.png width=538 height=65 alt=Steam>
        </td>
      </tr>
    </table>