【发布时间】:2018-02-08 20:51:32
【问题描述】:
我正在使用内联样式编写 html 电子邮件,因为我将在 Outlook 中发送它并阅读这是规避浏览器重新格式化的最佳方法。我想将下面的两个链接居中,我将它们放入表格单元格中,因为这是我可以让填充在 Outlook 中工作的唯一方法。我希望 2 个链接在页面上以背景和填充居中显示,但我不知道如何使用内联样式和表格来做到这一点。任何人都可以帮忙吗?谢谢!
<!DOCTYPE html>
<html>
<head>
<title>email blast re films</title>
</head>
<body>
<table>
<tr>
<td style="padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px; font-size: 14px; background: #3D87F5; color: white;">
<a href="http://bartonlewisfilm.com/artwork/4258558-wall-cuts-train-stations-New-York-City-excerpt.html" style="padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px; background: #3D87F5; text-decoration: none; color: white; border-radius: 5px;" title="watch wall cuts, train stations, New York City" target="_blank;">Watch my film "wall cuts, train stations, New York City"</a>
</td>
</tr>
</table>
<table>
<tr>
<td style="padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px; font-size: 14px; background: #3D87F5; color: white;">
<a href="http://http://bartonlewisfilm.com/artwork/4264539-red-hook-rush-hour-excerpt.html" style="padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px; background: #3D87F5; text-decoration: none; color: white; border-radius: 5px;" title="watch red hook, rush hour" target="_blank;">Watch my film "red hook, rush hour"</a>
</td>
</tr>
</table>
<table>
<tr>
<td style="font-size: 14px; text-align: center; padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px; background: #3A8E47;">
<a href="http://www.bartonlewisfilm.com" style="display: inline-block; padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px; background: #3A8E47;
text-decoration: none; color: white;" title="visit bartonlewisfilm.com" target="_blank;">bartonlewisfilm.com</a> | home (718) 399-8344 | cell (347) 325-4415
</td>
</tr>
</table>
</body>
</html>
【问题讨论】:
-
如果要使单元格的内容居中,可以在 td{ } text-align:center; 中添加样式和垂直对齐:中间;
-
使文本在 td 内居中,但我想将 td 在页面上居中。
-
然后把表格放在一个div里面,把div放在绝对位置
-
或将表格高度和宽度设为100%;和 td 一样,看我的回答我更新了
标签: html outlook html-table inline centering