Outlook在Exchange中使用HTML的签名

huangapple go评论51阅读模式
英文:

Outlook signature with HTML in Exchange

问题

我被要求在Outlook中创建一个通用签名。观看了一些教程后,我编写了一段HTML代码以将其放入Exchange。

问题在于在Outlook应用程序中,图标旁边的项目没有居中,但如果我执行.html文件,则显示正确。

有人知道我哪里出错了吗?

这是我的代码:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Logo Firma</title>
    </head>
    <body>
        <table>
            <tbody>
                <tr>
                    <td style="border-right: 3px solid #007cc2;"><img style="padding-right: 10px; display: flex;" src="https://i.postimg.cc/26xJ0Pz7/logo.png"></td>
                    <td>
                        <table style="font-family: Arial, Helvetica, sans-serif; color: #111628; padding-left: 10px;">
                            <tbody>
                                <!--NOMBRE DE LA PERSONA-->
                                <tr><td style="font-size: 14px; font-weight: bold;">Full Name</td></tr>
                                <!--DEPARTAMENTO AL QUE PERTENECE-->
                                <tr><td style="font-size: 12px; font-weight: bold;">Area</td></tr>
                                <!--TELEFONO DE LA EMPRESA E INTERNO-->
                                <tr><td style="padding-top: 5px; display:flex; align-items: center; font-size: 12px;"><img style="float: left; padding-right: 10px; width: 20px; height: 20px" src="https://i.postimg.cc/zDSGNj8H/phone.png"> 22223344</td></tr>
                                <!--CELULAR-->
                                <tr><td style="padding-top: 5px; display:flex; align-items: center; font-size: 12px;"><img style="float: left; padding-right: 10px; width: 20px; height: 20px" src="https://i.postimg.cc/NMRf58XV/smartphone.png"> +123 94333222</td></tr>
                                <!--PAGINA WEB DE LA EMPRESA-->
                                <tr><td style="padding-top: 5px; display:flex; align-items: center; font-size: 12px;"><img style="float: left; padding-right: 10px; width: 20px; height: 20px" src="https://i.postimg.cc/vHYHZVZq/globe.png"> <a style="text-decoration: none; color: #111628;" href="www.akesse.com.uy/" target="_blank"> Pagina Web</a></td></tr>
                                <!--DIRECCION DE LA EMPRESA-->
                                <tr><td style="padding-top: 5px; display:flex; align-items: center; font-size: 12px;"><img style="float: left; padding-right: 10px; width: 20px; height: 20px" src="https://i.postimg.cc/ZncbLTVx/map-pin.png"> Somewhere<br>City, Country</td></tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    </body>
</html>

这是在Google Chrome上的外观
这是在Outlook App上的外观

我不知道还能做什么,我尝试修改CSS样式,但结果并不如我所期望的那样。

英文:

I was asked to do a general signature in Outlook. After watching some tutorials, I wrote a code in HTML to put it in Exhange.

The problem is that in Outlook App the items next to the icons are not center, but if I execute the .html file It looks correct.

Does anybody know where I'm failing?

Here's my code:

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
&lt;title&gt;Logo Firma&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;border-right: 3px solid #007cc2;&quot;&gt;&lt;img style=&quot;padding-right: 10px; display: flex;&quot; src=&quot;https://i.postimg.cc/26xJ0Pz7/logo.png&quot;&gt;&lt;/td&gt;
&lt;td&gt;
&lt;table style=&quot;font-family: Arial, Helvetica, sans-serif; color: #111628; padding-left: 10px;&quot;&gt;
&lt;tbody&gt;
&lt;!--NOMBRE DE LA PERSONA--&gt;
&lt;tr&gt;&lt;td style=&quot;font-size: 14px; font-weight: bold;&quot;&gt;Full Name&lt;/td&gt;&lt;/tr&gt;
&lt;!--DEPARTAMENTO AL QUE PERTENECE--&gt;
&lt;tr&gt;&lt;td style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Area&lt;/td&gt;&lt;/tr&gt;
&lt;!--TELEFONO DE LA EMPRESA E INTERNO--&gt;
&lt;tr&gt;&lt;td style=&quot;padding-top: 5px; display:flex; align-items: center; font-size: 12px;&quot;&gt;&lt;img style=&quot;float: left; padding-right: 10px; width: 20px; height: 20px&quot; src=&quot;https://i.postimg.cc/zDSGNj8H/phone.png&quot;&gt; 22223344&lt;/td&gt;&lt;/tr&gt;
&lt;!--CELULAR--&gt;
&lt;tr&gt;&lt;td style=&quot;padding-top: 5px; display:flex; align-items: center; font-size: 12px;&quot;&gt;&lt;img style=&quot;float: left; padding-right: 10px; width: 20px; height: 20px&quot; src=&quot;https://i.postimg.cc/NMRf58XV/smartphone.png&quot;&gt; +123 94333222&lt;/td&gt;&lt;/tr&gt;
&lt;!--PAGINA WEB DE LA EMPRESA--&gt;
&lt;tr&gt;&lt;td style=&quot;padding-top: 5px; display:flex; align-items: center; font-size: 12px;&quot;&gt;&lt;img style=&quot;float: left; padding-right: 10px; width: 20px; height: 20px&quot; src=&quot;https://i.postimg.cc/vHYHZVZq/globe.png&quot;&gt; &lt;a style=&quot;text-decoration: none; color: #111628;&quot; href=&quot;www.akesse.com.uy/&quot; target=&quot;_blank&quot;&gt; Pagina Web&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!--DIRECCION DE LA EMPRESA--&gt;
&lt;tr&gt;&lt;td style=&quot;padding-top: 5px; display:flex; align-items: center; font-size: 12px;&quot;&gt;&lt;img style=&quot;float: left; padding-right: 10px; width: 20px; height: 20px&quot; src=&quot;https://i.postimg.cc/ZncbLTVx/map-pin.png&quot;&gt; Somewhere&lt;br&gt;City, Country&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;

This is how it looks on Google Chrome
This is how it looks on Outlook App

I don't know what else to do, I've try modifying CSS styles but It did not result as I expected.

答案1

得分: 0

Outlook(桌面版 Windows?)不支持display: flex,或对display的任何更改。您必须使用一个td标签来放置图像,另一个td标签来放置文本,并使用内边距(padding)和行高(line-height)来垂直居中它们。

因此,未经测试的代码如下:

<tr>
    <td style="padding: 5px;"><img width="20" height="20" src="https://i.postimg.cc/ZncbLTVx/map-pin.png"></td>
    <td style="padding: 5px; font-size: 12px; line-height: 16px;">Somewhere<br>City, Country</td>
</tr>

请注意,width=和height=属性的使用,这在Outlook中是必需的(Outlook不识别在img标签中使用style="width..."的方式)。

英文:

Outlook (desktop Windows?) doesn't support display:flex, or any changes to display. You have to use a td for the image, and another td for the text, and use padding and line-height to vertically center them.

So, untested:

&lt;tr&gt;&lt;td style=&quot;padding: 5px;&quot;&gt;&lt;img width=&quot;20&quot; height=&quot;20&quot; src=&quot;https://i.postimg.cc/ZncbLTVx/map-pin.png&quot;&gt;&lt;/td&gt;&lt;td style=&quot;padding: 5px; font-size: 12px;line-height:16px;&quot;&gt; Somewhere&lt;br&gt;City, Country&lt;/td&gt;&lt;/tr&gt;

Note the use of width= and height=, needed for Outlook (it doesn't recognise style="width..." in the img tag).

huangapple
  • 本文由 发表于 2023年2月14日 22:03:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75448954.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定