H1 tag still has padding or margin at the bottom, although none are set

The H1 tag still has padding or margins below, although none are set.

I have an h1 tag and some text below. I set margin and insanity to 0 on both, and the text is still not sitting right under the text h1.

I created a js script to illustrate my point

http://jsfiddle.net/6hCrC/

+5
source share
6 answers

No indentation. There is only a space, highlighted by default line-heightand without characters with descenders (e.g. p, q and g) in the text.

http://jsfiddle.net/6hCrC/1/

+12
source

font , line-height. line-height of H1.

http://jsfiddle.net/6hCrC/4/

+4

Try using line-height: 70px;

Hope this helps!

+3
source

This is somehow related to the line-height. Perhaps an alternative would be to set a negative margin for the first paragraph.

Here is a jsfiddle example

http://jsfiddle.net/6hCrC/3/

Alternatively, you can set the line height to a value other than auto (default)

+1
source

Adjust the line height. http://jsfiddle.net/6hCrC/13/

+1
source

The best solution is here:

h1, h2, h3, h4 {line-height: 1em;}
0
source

All Articles