By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,631 Members | 892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,631 IT Pros & Developers. It's quick & easy.

indentations and line spacing within lists - I'm having problems

P: n/a
I am trying to use css to control the indentation within items in a
list. I would like something that looks like this:
Text of a paragraph goes here, leading to the following list:

* list item 1
* list item 2
* and so on

++++++++

Now the features of the above are:

1. The paragraph has a left margin of 4%. That is, it's left edge is
4% from the edge of the browser window.

2. Skip a line prior to the list beginning.

3. The * represents a bullet or a number - just the symbol
representing the start of a new list item

4. I want the list indented relative to the paragraph.

5. I want single spacing between list items.

Nothing I've tried seems to accomplish what I want. I thought that
using css to set up margin-left: +2% for ul, ol, and li would cause
the margin to be 2% farther left than the existing paragraph margin.
No luck. I thought that line-height: 1 would cause single spacing; it
doesn't. Actually, line-height: .5em seems to work in Netscape and
IE, but I'm not comfortable with that.

So what do I say for ol, ul, li in my style section to accomplish
this?
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article <on********************************@4ax.com> in
comp.infosystems.www.authoring.stylesheets, puzzled wrote:

[two issues in lists: indentation and vertical spacing]

For indentation, you need to set more than one property. Eric Meyer
explains it excellently at
<http://devedge.netscape.com/viewsource/2002/list-indent/>.
Nothing I've tried seems to accomplish what I want.


I don't understand the difficulty with spacing. Set
ul, ol { margin-top: 1em; padding-top: 0 }
li { margin-top: 0; padding-top: 0 }
and that ought to do the trick.

Perhaps if you posted the URL of your best (even though imperfect)
effort...

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #2

P: n/a
On Sun, 14 Dec 2003 00:06:17 -0500, Stan Brown
<th************@fastmail.fm> wrote:
In article <on********************************@4ax.com> in
comp.infosystems.www.authoring.stylesheets, puzzled wrote:

[two issues in lists: indentation and vertical spacing]

For indentation, you need to set more than one property. Eric Meyer
explains it excellently at
<http://devedge.netscape.com/viewsource/2002/list-indent/>.


My problems were stemming from my accidentally applying a class to
ul/li that I hadn't intended to apply. The Eric Meyer article was
great. Using its simple recommendation, I got my margins the way I
wanted.

For vertical spacing, once I removed the unintended class from ul/li,
line-height: 1em worked as it should have.

Thanks.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.