3

I was setting up some signatures in HTML which will end up in Outlook. One issue I have is that when inserting a horizontal line, it inserts a large space above and a smaller space below the line. My issue is the very large space above the horizontal line. It's almost the size of a full break

<br>

If I manually edit the signature in Outlook by setting the spacing after the text that is just before the horizontal line it's okay, but I can't do this manually for the # of them I need to edit. Here is an example of my issue:

<html>
<head>
    <title>HTML Online Editor Sample</title>
</head>
<body>
    <p>
        <span style="font-size:12pt;"><span style="font-family: arial, helvetica, sans-serif;"><b>This is a test</b></span></span></p>
    <hr style="height: 2px; width: 99%; background-color: #848484" />
    <p>
        <span style="font-size:10pt;"><span style="font-family: arial, helvetica, sans-serif;"><b>Text under the line</b></span></span></p>
</body>
</html>

Is there a way I can tighten the text before or after the line?

4

4 回答 4

8

段落元素<p>有一些自然的填充和边距,所以尝试添加 padding: 0 和 margin: 0 到它们

于 2013-02-27T18:39:20.133 回答
3

hrp元素有一些由浏览器插入的填充/边距。添加margin: 0;以删除它。

于 2013-02-27T18:41:55.640 回答
1
<hr style="height: 2px; width: 99%; margin:0 auto;line-height:2px;background-color: #848484"; border:0 none; />

或者

<hr style="height: 0; width: 99%; line-height:0;border-bottom:2px solid #848484; background:none;" />

在这里摆弄

于 2013-02-27T21:02:31.223 回答
0

从重置 CSS 开始并从那里获取它总是好的。

有用的链接: http: //meyerweb.com/eric/tools/css/reset/

于 2013-02-27T20:17:07.207 回答