【发布时间】:2021-06-16 18:22:09
【问题描述】:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div style="background-color: grey" id="parent">
<div style="background-color: red">
content
</div>
<div style="margin: 10px; padding: 10px; background-color: yellow" id="child">margin and padding</div>
<div style="background-color: aquamarine">
aquamarine
</div>
</div>
</body>
</html>
注意#parent 元素的背景颜色(灰色)显示在#child 元素的边缘。
但是,如果我在 HTML 电子邮件中使用相同的标记并在 Outlook 中打开它,我会看到这个
在这种情况下,<body> 图像的背景颜色显示在#child 的边距中,而不是父元素的背景颜色。
有没有办法让 Outlook 的行为方式与浏览器相同?
【问题讨论】: