Spacing before a HTML Horizontal Line

Untalented picture Untalented · Feb 27, 2013 · Viewed 17.9k times · Source

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?

Answer

Michael Tichoň picture Michael Tichoň · Feb 27, 2013

Paragraph elements <p> have some natural padding anad marggin so try to add padding: 0 and margin: 0 to them