Re: list-item alignment in CSS

David,

 > There's a quick'n'dirty table-based list-item example at
 > <http://www.hpaa.com/css1/lists.html>. Is this the correct
 > interpretation?

Quoting from that page:

    UL { margin-left: 0 }
    UL LI { 
      background: #CC3366;
      font-size: 17px; 
      line-height: 20px;
      margin-left: 40px; 
      margin-bottom: 6px 
    }

To be safe, I'd set padding and border to 0 as well.

  How it should be rendered (list simulated with a table):

  The left margin of this text should be 40 pixels to the right of the
  previous element's left margin.

Correct if you by "left margin" mean the "left inner edge".

  The background color should extend all the way to the right margin
  because this is a block-level element.

Correct. 

  The background color should extend only to the edges of the text at
  the left, top, and bottom, because there is no padding.

Correct

  The list bullet should not have any background color because
  background color is not inherited.

I'd say: "The background of the list-item marker should be that
of the UL element, not the LI element."

  The list bullet's horizontal position is undefined. Your browser can
  put it wherever it wants to.

Correct. 

Also, in right=to-left text, the markers would have been on the right
side of the box.

  There should be a 6 pixel space between the element blocks because
  there is a 6 pixel bottom margin on LI.

Correct.

Regards,

-h&kon

H   å   k   o   n      W   i   u   m       L   i   e
howcome@w3.org   W o r l d   Wide  W e b  Consortium
inria §°þ#¡ª FRANCE http://www.w3.org/people/howcome

Received on Friday, 6 June 1997 18:49:53 UTC