Block-indent with :before

(This suggestion is an alternative to a previous "list-item display
type" message.)

Along with :before and :after pseudo-elements, a new property
'block-indent' is needed. The 'block-indent' property would be a more
general version of the 'list-style-position' property, applicable to
any block element. It would eliminate the need to apply a negative
margin to the :before pseudo-element in order to get an equivalent
rendering to 'list-style-position: outside'.

With the block-indent property and the :before pseudo-element, list
items could be defined entirely in terms of more general CSS
properties, eliminating the need for a separate list-item display type.

The block-indent property would act as a secondary margin that does not
affect floated child elements as margin does. This example specifies an
equivalent to a typical unordered list:

  UL LI        { block-indent: outside }
  UL LI:before { float: left;
                 content: disk }

The 'outside' keyword indicates that the content should be to the right
of any left-floated before: pseudo-element, corresponding to typical
default browser behavior.

Note that it is not necessary to specify any caveats regarding the use
of 'block-indent' and ':before' with list-items because it can be
assumed that list-items have _default_ block-indents and :before
pseudo-elements that are being overridden.

David Perrell

Received on Wednesday, 7 May 1997 17:30:41 UTC