检查下面的代码以帮助我将我的 Gmail 按钮居中

Check the code below to help me centre my gmail button

我对 html 非常陌生。我主要是复制粘贴一些代码作为我的框架,并对其进行自定义以使我的电子邮件正常工作。我的电子邮件有这段代码,但我似乎无法让选择加入按钮居中。我试过阅读其他类似的问题,但我的编码知识是初学者的,我无法理解他们的编码解决方案,其中代码略有不同,如何与我的代码相关联以找到解决方案。我正在添加 style=text-align: center;在几个地方,但它没有用。还有其他解决方案,但我不太了解它们在我的代码中的工作方式。几个小时以来,我一直在努力解决这个问题。非常沮丧。

除了居中它在电子邮件中起作用。

<td valign="middle" style="text-align: center; padding: 0px 10px 10px 
0px;">You've previously contacted us at Business Name.&nbsp;<br>We 
are <b>only sending this email once</b> to our current client list to 
invite you to join our new free monthly e-newsletter.&nbsp;<br>

 style="text-align: center;
<table width="100%" cellspacing="0" cellpadding="0"><tbody><tr>
  <td>
      <table cellspacing="0" cellpadding="0">
          <tbody><tr>
              <td style="border-radius: 2px;" bgcolor="#018736">
                  <a href="https://www.businessname.com/community- 
 newsletter.html" target="_blank" style="padding: 10px 32px; border: 1px 
 solid #018736;border-radius: 2px;font-family: Helvetica, Arial, sans- 
serif;font-size: 24px; color: #ffffff;text-decoration: none;font- 
 weight:bold;display: inline-block;">
                      OPT-IN             
                  </a>
              </td>
          </tr>
      </tbody></table>
  </td>
 </tr>
</tbody></table>


<br>Grief is a difficult thing. If you choose not to join our free 
monthly newsletter at this time we understand, but will not be sending 
any other emails to you going forward. <br><br></td>

离开你所拥有的,我认为将 style="text-align: center; 扔到你的 link 按钮所在的 <td> 上应该可以解决问题。此外,您可能还想摆脱其他 style="text-align: center; 浮动在第一个标签上方的代码,它是在您的页面上显示为文本的代码。

使用下面的代码:

 <td valign="middle" style="text-align: center; padding: 0px 10px 10px 
    0px;">You've previously contacted us at Handsome Stitchery.&nbsp;<br>We 
    are <b>only sending this email once</b> to our current client list to 
    invite you to join our new free monthly e-newsletter.&nbsp;<br>
    <table width="100%" cellspacing="0" cellpadding="0"><tbody><tr>
      <td style="text-align:center;">
          <table cellspacing="0" cellpadding="0" style="margin:0 auto;">
              <tbody><tr>
                  <td style="border-radius: 2px;" bgcolor="#018736">
                      <a href="https://www.handsomestitchery.com/community- 
     newsletter.html" target="_blank" style="padding: 10px 32px; border: 1px 
     solid #018736;border-radius: 2px;font-family: Helvetica, Arial, sans- 
    serif;font-size: 24px; color: #ffffff;text-decoration: none;font- 
     weight:bold;display: inline-block;">
                          OPT-IN             
                      </a>
                  </td>
              </tr>
          </tbody></table>
      </td>
     </tr>
    </tbody></table>


    <br>Grief is a difficult thing. If you choose not to join our free 
    monthly newsletter at this time we understand, but will not be sending 
    any other emails to you going forward. <br><br></td>