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?

GordonsBeard
  • 636
  • 4
  • 14
Untalented
  • 57
  • 1
  • 3
  • 7

4 Answers4

8

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

Michael Tichoň
  • 281
  • 2
  • 10
  • This seems to be the case in this question, but there might be [other issues](http://en.blog.improveit.com.br/articles/2008/09/27/margins-on-the-hr-tag-a-case-solved) that could be addressed. – GordonsBeard Feb 27 '13 at 18:41
3

The hr and p elements have some padding/margins inserted by the by the browser. Add margin: 0; to remove that.

Tom Oakley
  • 6,065
  • 11
  • 44
  • 73
1
<hr style="height: 2px; width: 99%; margin:0 auto;line-height:2px;background-color: #848484"; border:0 none; />

OR

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

fiddled here

Milche Patern
  • 19,632
  • 6
  • 35
  • 52
0

Always good to start with a reset CSS and take it from there.

Useful link: http://meyerweb.com/eric/tools/css/reset/

AdamRox
  • 85
  • 9