On Aug 3, 2011, at 10:44 PM, Ghodmode wrote:

>> http://www.w3.org/TR/CSS21/generate.html#counters
> 
> That's much better than my solution: counter-reset.
> 
> One thing I'm not clear on is the identifier name.
> 
> I couldn't find a list of valid identifiers for the counter-reset and
> what type of element they refer to.
> 
> In the provided examples, I see things like "item", "section",
> "subsection", etc...  I thought they might have been classes or IDs,
> but I also saw some examples with elements that didn't have IDs or
> classes.

here are 2 examples I had laying around:
http://dev.l-c-n.com/CSS2/counter/counters-1.html
http://dev.l-c-n.com/CSS2/counter/counters-2.html

>> Set a width on the generated counter wide enough to allow for the highest 
>> number in your list ( + display:inline-block ).
> 
> How do you do that?  With the :before pseudo-element?

The ::before element holds the numbering, you just force it to be wide enough 
to contain the largest number;

li::before {
display: inline-block;
width: 3em; /* adjust to needs */
color: red;
/* and more styling */
}

Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
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/

Reply via email to