5个回答

1

我知道这是一个老问题,但我在寻找解决方案时(Outlook中可点击整个按钮),偶然发现了以下解决方案:

<table border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td align="center" valign="middle" >

<!-- start of Outlook compatible button generated by http://buttons.cm/ -->
<div><!--[if mso]>
  <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://yoururlhere.com/" style="height:52px;v-text-anchor:middle;width:330px;" arcsize="10%" stroke="f" fillcolor="#2fba45">
    <w:anchorlock/>
    <center>
  <![endif]-->
      <a href="http://yoururlhere.com/"
style="background-color:#2fba45;border-radius:5px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:52px;text-align:center;text-decoration:none;width:330px;-webkit-text-size-adjust:none;">Yes please, send me a quote.</a>
  <!--[if mso]>
    </center>
  </v:roundrect>
<![endif]--></div>
<!-- end of Outlook compatible button generated by http://buttons.cm/ -->

            </td>
        </tr>
    </tbody>
</table>

请注意,我没有测试上面的代码。

其他答案确实链接到了campaignmonitor网站,但没有提供解决方案的这个链接

campaignmonitor的博客文章提到,他们创建了一个特定的网站来生成与Outlook兼容的可点击按钮-http://buttons.cm,这是基于Stig M(@stigm在Twitter上)创建的解决方案。

我不为campaignmonitor工作。

希望能帮到某些人。


0
使用JavaScript的"innerHTML"属性。在HTML5中,默认情况下,您无法直接在表格单元格元素中添加锚标签。
<html>
<title>
</title>
<head>
</head>
<body>

    <table>
        <thead>
             <tr>
                 <td>Youtube</td>
                 <td id="assign_anchor_tag_here"></td>
            </tr>
        <thead>
    </table>

<script>
    var td_element = document.getElementById("assign_anchor_tag_here");
    td_element.innerHTML = "<a href='https://www.youtube.com'>Click Here!</a>";
</script>

0
尝试一下。

http://jsfiddle.net/KrRzP/

<table border="0" cellpadding="0" cellspacing="0"   style="border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-color: #2FBA45;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt; cursor:pointer;">
    <tbody>                 
        <tr>
            <td align="center" valign="middle"  style="font-family: Arial;font-size: 22px;padding: 15px;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">
                <a  href="http://www.example.org" title="Yes please, send me a quote."  target="_self" style="font-weight: bold;letter-spacing: -0.5px;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;word-wrap: break-word !important; display:block; width:100%; height:100%">Yes please, send me a quote.</a>
            </td>  
        </tr>
    </tbody>
</table>

它甚至在浏览器中也无法工作,有没有办法像使用span等方式改变我的代码以获得相同的输出? - user2088260

0
你可以尝试使用 onClick<td onClick="go to anchor">。在内联样式中,你应该添加 cursor: pointer,这样鼠标指针就会变成“悬停链接”指针。

0

尝试移除 target="_self"。由于 Outlook 是电子邮件客户端,它可能无法识别它,并导致问题。

顺带一提,如果您在电子邮件中使用锚链接(连接到同一页上的其他位置),这并不是所有电子邮件浏览器都完全支持的。这里有support chart


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接