[thelist] CSS: How to adjust line height in header tags?

H. G. Quinn hgquinn at attglobal.net
Tue Jul 25 19:08:57 CDT 2000


H1 {
    font-family: Verdana;
    font-size: 14pt;
    margin-bottom: 0px;
    margin-top: -1ex;
    line-height: 4ex;
}
H2 {
    font-family: Verdana;
    font-size: 13pt;
    margin-bottom: 0px;
    margin-top: -1ex;
    line-height: 4ex;
}
P {
    font-family: Verdana;
    font-size: 12pt;
    margin-top: -1ex;
    line-height: 2ex;
}


...is the best compromise I can find that gives tight spacing in both
browsers, while still allowing for ascenders and descenders.

An "ex" is the height of a lowercase "x" in the font specified, so it's
proportional relative to the font, and won't cause NN to spit out thousands
of pages if someone decides to print the documents.  (A non-proportional
line-height _will_ have that effect, though, so don't use line-height in
pixels or points, whatever you do).


Amy Roberts wrote:

> Forgive me if this was discussed already. I am looking for a CSS way to
> adjust the line spacing below the header or subheader using <H2>, <H3>,
> etc tags. I want to be able to reduce the spacing between the header and
> paragragh below without changing the tags, if at all possible (have over
> 600 pages to deal with)
>
> Currently I am using
> H2 { font-family: verdana; font-size: 14pt }
> H3 { font-family: verdana; font-size: 13pt }
> P { font-family: verdana; ont-size: 11pt }
>
> I  tried line-height for P but that didn't seem to have any effect to
> the header above.
>
> Suggestions will be appreciated!
> Amy

Cheers,
--
Heather Quinn
hgquinn at attglobal.net
http://pws.prserv.net/windyhill






More information about the thelist mailing list