Translate This Page



Solving that line space problem in HTML

Yes, I also had so much trouble finding an answer to this.
I think I looked for days.


The trick is to remember that tags are all spaced by Margins.
If you only think of Padding, you'll get frustrated, as I did.

Here it is:
In your CSS style area in the header or on your CSS stylesheet,
list your paragraph tags like so:

p{
    font-size:12px;
    margin-top:0px;
    margin-bottom:0px;
}
h1{
    margin-bottom:0px;
    margin-top:0px;
    margin-right:0px;
    margin-left:0px;
}

or like so:

h2 {margin-bottom:0px; margin-top:0px;}
h3 {margin-bottom:0px; margin-top:0px;}
h4 {margin-bottom:0px; margin-top:0px;}
h5 {margin-bottom:0px; margin-top:0px;}

You can also see what I did in my header for this page by selecing Source in your browser.