Re: positioning in ordered lists
am 24.08.2007 10:33:03 von dorayme
In article ,
"Stann" wrote:
> Hello,
>
> I'm working with ordered lists. The default list is indented about the same
> amount as a would do. Is there any way to over-ride or tweak
> this, so the list is not indented at all?
First set
ul {margin: 0;padding: 0;}
li {margin: 0;padding: 0;}
to see the effect. Then you can adjust to your heart's content.
You do know about css? If you don't and want quick, in the html,
put:
and so on.
Otherwise, put this sort of thing in the head of the document:
Otherwise and best if you have a more styles, put a link in the
head to a separate style sheet.
--
dorayme
Re: positioning in ordered lists
am 27.08.2007 20:56:07 von Ben C
On 2007-08-24, Jukka K. Korpela wrote:
[...]
> Surely. As "dorayme" tells in his/her reply, you can set the margins and
> paddings to zero. However, there's an important side effect: there won't be
> any room for the numbers then.
>
> Thus, you could set all the margins and paddings to zero _except_
> margin-left for (or the - elements), which should be set to a value
> that is sufficient for the number, the period, and the spacing before the
> list item content. This is not exact science, but
>
> ol, li { margin:0; padding: 0; }
> ol { margin-left: 1.6em; }
>
> would typically result in "unindented" numbered list. But don't blame me if
> part of the numbers gets chopped off under some circumstances. The only way
> to get exact results (with the usual caveats) is to make the numbers part of
> the content:
There is another caveat which is that the 40px margin-left (or
padding-left) for ol and ul in the default stylesheet is not really
margin-left but "margin-nearside" or "margin-start", because it turns
into a right margin if the element's computed value of direction is rtl.
This isn't in the CSS spec but if browsers didn't do it then simple
nested lists would look pretty stupid in the right-to-left direction,
lacking any indentation or space for bullets.
It's a caveat because if you set margin-left yourself it really does
mean margin-_left_, not margin-nearside, in browsers I've tried (and I
agree with this interpretation), and so your lists will look bad if
their direction is rtl.
If OP's not using rtl then it doesn't matter.