Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML电子邮件-在定义了宽度和高度的元素中居中放置图像_Html_Css_Email_Html Email - Fatal编程技术网

HTML电子邮件-在定义了宽度和高度的元素中居中放置图像

HTML电子邮件-在定义了宽度和高度的元素中居中放置图像,html,css,email,html-email,Html,Css,Email,Html Email,我有下面的代码。 如果我在浏览器上运行此代码,一切正常 但是,在HTML电子邮件中:代码没有按预期工作 高度似乎是主要问题,我自动配置的height在HTML电子邮件中变成了minheight 这就是它在电子邮件上的样子: 我的最终目标是:在HTML电子邮件中定义了宽度和高度的元素内,将图像水平和垂直居中(所需输出的示例在下面的runnable代码段中) 成人经典T恤 $ 21.00 成人经典T恤 $ 21.00 您应该用文字描述这一问题的答案。它的中心部分是什么?你的代码甚至不

我有下面的代码。
如果我在浏览器上运行此代码,一切正常

但是,在HTML电子邮件中:代码没有按预期工作

高度似乎是主要问题,我自动配置的
height
在HTML电子邮件中变成了
minheight

这就是它在电子邮件上的样子:

我的最终目标是:在HTML电子邮件中定义了宽度和高度的元素内,将图像水平和垂直居中(所需输出的示例在下面的runnable代码段中)


成人经典T恤 $ 21.00

成人经典T恤 $ 21.00
您应该用文字描述这一问题的答案。它的中心部分是什么?你的代码甚至不能正确地将图像居中。
<table>

  <tbody>
    <tr>
      <td style="padding-top:10px;">
        <p style="text-align:center;height: 105px;background-color:#282828;width: 80px;vertical-align: middle; display: table-cell;" height="85">
          <span style="display:inline-block;height: 100%;vertical-align:middle;" height="85px"></span>
          <img width="50" style="/* min-height:80%; */vertical-align:middle;" src="https://ecp.yusercontent.com/mail?url=http%3A%2F%2Fawsdevelopment.tzilla.com%2Fartwork%2Fgenerate%2F285cf3ee-4ecc-40ee-917d-d743eba4da8e-out.png&amp;t=1542159076&amp;ymreqid=b0ed4f41-e1fa-3871-1c54-fe002f014500&amp;sig=.ZExttgldk1nd96JyybAyQ--~C">
        </p>
      </td>

      <td>
        <span>Adult Classic Tee</span>
      </td>

      <td>
        $ 21.00
      </td>

    </tr>

  </tbody>
</table>