css - 边框半径在 Windows Outlook 上的电子邮件模板中不起作用
问题描述
我border-radius
在 Outlook 应用程序上的电子邮件模板中遇到问题。我也尝试过-WebKit-border-radius
,-ms-border-radius
但它仍然无法在 Outlook 应用程序中运行。
table {
width: 32px !important;
border-radius: 50px;
-webkit-border-radius: 50px;
-ms-border-radius: 50px;
-moz-border-radius: 50px;
color: #FFFFFF;
font-weight: bold;
font-size: 12px;
text-align: center;
}
<table align="center" height="32" width="32" bgcolor="#293248" cellspacing="0 " cellpadding="0 "></table>
解决方案
Outlook 不支持 CSS3,因为边框半径是 CSS3 属性,它在 Outlook 中不起作用。但它们是您问题的替代解决方案。在 Outlook 2010,2013,2016,2019 中进行测试时,使用下面的代码将在 Outlook 中工作
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.EXAMPLE.com/" style="height:40px;v-text-anchor:middle;width:300px;" arcsize="10%" stroke="f" fillcolor="#d62828">
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:16px;font-weight:bold;">
Button Text Here!
</center>
</v:roundrect>
<![endif]-->
<!--[if !mso]> <!-->
<table cellspacing="0" cellpadding="0"> <tr>
<td align="center" width="300" height="40" bgcolor="#d62828" style="-webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; color: #ffffff; display: block;">
<a href="http://www.EXAMPLE.com/" style="color: #ffffff; font-size:16px; font-weight: bold; font-family:sans-serif; text-decoration: none; line-height:40px; width:100%; display:inline-block">
Button Text Here!
</a>
</td>
</tr> </table>
<!-- <![endif]-->
推荐阅读
- angularjs - AngularJS:从另一个组件的模板中渲染一个组件
- python - 如何在python中将十六进制字符串转换为彩色图像?
- python - 如何从由不同线程调用的回调中调用异步函数?
- ruby-on-rails - 在 Ruby PG Gem 中使用代理
- vba - Excel VBA 自动化
- python - 查找附近重复视频的算法
- ignite - 测试 apache ignite 的大型数据集?
- javascript - 对云功能的 Cron http 请求 - 查看数据库
- java - 摆动计时器启动时,ActionListener 类不断重复
- svg - 如何重用从 highcharts 生成的 SVG 作为背景