Jeremy Collins <jd********@ntl world-not.com> wrote:
You could also try line-height:150%
Well, yes, but it has a quite different meaning. Using margin-top and
margin-bottom for li elements is fine. One just needs to remember that
vertical margins don't add up. If you specify
li { margin-top: 0.5em; margin-bottom: 0.8em; }
then the distance between list items is not 0.5em + 0.8em but larger of
0.5em and 0.8em.
The line-height property sets the line height within an element. While
this may create the impression of separation of list items, it's
deceptive. When the display area is narrowed, so that list item
contents wrap, the effect is probably rather disturbing.
(I think anything over 120%
is larger than most browser defaults).
Probably so, despite the fact that CSS specifications recommend that
the default be between 1.0 and 1.2 and even uses the following settings
in the sample style sheet (which is presented as non-normative, yet as
recommended browser default style, and also presented as summary of
actual study of browser behavior, despite the fact many features there
have just been made up):
CSS 1: line-height: 1.1
CSS 2: line-height: 1.33 (above the range recommended in the spec!)
CSS 2.1 CR: line-height: 1.12
What browsers actually use seems to be near 1.2.
The conclusion is that due to this confusion, and due to the fact that
1.2 is too small for many fonts (especially for sans-serif fonts when
line length is large, as it may well be on the Web), authors should
probably set the body element's line-height to a reasonable value
like 1.25 or 1.3. I would use plain numbers due to problems of
inheritance. (If you set e.g. line-height: 150% for a li element, then
the line height inside the element will be 150% of the element's font
size, even in subelements which may have different font sizes - since
the computed value is inherited, not the percentage, but for plain
numbers, it's the number that gets inherited, and gets interpreted in
relation to each element's own font size.)
--
Yucca,
http://www.cs.tut.fi/~jkorpela/