On Jul 17, 2009, at 3:08 PM, David Hucklesby wrote:

>> Is it possible with CSS - possibly CSS 3 - to apply style to the
>> things which mark list items?
>>
>> I have an ordered list, so list items are marked with "1.", "2.",
>> etc.
>>
>> I want to make those numbers white on a blue background, and I don't
>> want to change the style of the actual list items (want to leave the
>> actual list items black on a white background)
>>
> The only way I know involves adding a SPAN or other in-line element to
> wrap the content of each list item. Viz:
> HTML
>   <ul>
>     <li><span> ... content ... </span></li>
>     <li><span> ... content ... </span></li>
>     <li><span> ... content ... </span></li>
>       .
>       .
>   </ul>
> CSS
>   ul { color: white; background: blue; }
>   li span { color: black; background: white; }

Counters will do what you want, whit lots of possibilities regarding  
styling.
http://www.w3.org/TR/CSS21/generate.html
sample page
http://dev.l-c-n.com/css2/counters-Ordered_list.html

But not in IE 6 & 7.

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





______________________________________________________________________
css-discuss [[email protected]]
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