css - MS Outlook 2010 标题混合

标签 css html header outlook

我绝对不是 CSS 或 HTML 专家,但我认为我的代码是正确的。当我在 Internet Explorer 中运行它时,它工作正常并在标题之间显示一些空白,这是应该的。但是当我将它发送到 MS Outlook 2010 时,标题混合在一起。而且我似乎无法找到一种方法来以干净的方式解决这个问题......

MS Outlook 2010(不正常):

MS Outlook 2010

Internet Explorer(正常):

enter image description here

HTML/CSS 代码:

<!DOCTYPE html>
<html><head><style type="text/css">
body {
    font-family:verdana;
    background-color:white;
}
h1 {
    background-color:black;
    color:white;
    margin-bottom:0px;
    text-indent:10px;
}
h2 {
    background-color:lightGrey;
    margin-bottom:10px;
    text-indent:10px;
}
p {
    font-size: 14px;
    margin-left:10px;
}
</style></head><body>
<h1>My Big Title</h1>
<h2>My Smaller title:</h2>
<p>Hello world :)</p>
</body></html>

感谢您帮助解决这个讨厌的小问题。

h1 更改为 margin-bottom:10px; 也没有解决它:

enter image description here

最佳答案

通过添加 page-break-before: always; 修复它,如 this post 中所示.

我很高兴我解决了这个问题!困扰我很久了。

修复:

h1 {
    background-color:black;
    color:white;
    margin-bottom:10px;
    text-indent:10px;
    page-break-before: always;
}
h2 {
    background-color:lightGrey;
    margin-bottom:10px;
    text-indent:10px;
    page-break-before: always;
}

关于css - MS Outlook 2010 标题混合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29429854/

相关文章:

language-agnostic - 使用头文件有什么好处和坏处?

javascript - 如何实现类似于 Stack Overflows Tag 的小部件?

css - 嵌入式字体样式不适用于移动设备

javascript - 如何根据输入字段禁用 <td>

javascript - 使用 jQuery 构建 HTML 表格

image - 带有透明工具栏的Android L Activity 标题图片,并在滚动时折叠

html - 如何在表格后居中分页按钮?文本对齐不起作用

css - 覆盖使用 :not Selector 的 CSS

html - 内联图像支持的差异?

c - 如何创建头文件和文件处理