At 6/22/2009 01:51 AM, BobSharp wrote:
>http://ttphp.open.ac.uk/~bs3578/test1/Week07_05-01.php
>
> >BobSharp wrote:
> >
> > How would you decrease the inherant spacing between
> > headings on ol: lines and the listings on li: lines ?
To begin, clean up your markup by removing the BReak tags from
between your LIs.
1) XHTML doesn't permit any children of a UL except LI.
2) Avoid using markup to force presentation. Instead, use CSS.
3) LI is by default a block-level element, which means that HTML
lists render vertically by default, so you don't need to force the
list items to render on separate lines.
(If you had styled them as inline or floated so they wanted
to render on the same row, there are better ways of forcing them into
a vertical list than by inserting break tags, even in legal
positions. But you're not creating that situation so all the break
tags are doing (other than invalidating your markup) is increasing
vertical spacing between your unordered list items.
The W3C HTML Validator is your friend:
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fttphp.open.ac.uk%2F~bs3578%2Ftest1%2FWeek07_05-01.php
The answer to your question is that you can use top & bottom margin
and/or padding in your stylesheet to modify the default vertical
spacing between various elements.
Your list markup is:
<ul>
<li><h4>Surname</h4>
<ol>
<li>
...
If it's the vertical space between the surname heading and the list
below it that you want to decrease, I'd decrease the margin-bottom on
"ul h4" and/or the margin-top on "ul ol".
To replace the break tags I've suggested you remove, simply give each
ul li a margin-bottom of 1em or whatever, then counteract that with
ul ol li {margin-bottom: 0);
Regards,
Paul
__________________________
Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/