I have an ordered list which I have styled in two ways:
- Coloured the numbers differently to the list text
- Applied a background colour and border to each list item
See the list on the right hand side of this page
The numbers are made orange by first applying the orange style to the <li>, then applying the black style to the list text only using jQuery:
jQuery('#secondary ol li').wrapInner('<span class="notes"> </span>');
I would prefer to use CSS only, but hey.
So the remaining issue is how to extend the background colour/border under the numbers too.
Thanks for checking out my question!
Revised Answer: jsFiddle Pure CSS Solution
Here is a revised method that does not use the OP’s original jQuery framework, a request that was not fulfilled in my previous answer. That method used existing jQuery to apply a span wrapper for the
lielement since direct HTML modification was not possible.This new method uses CSS Pseudo selectors
:beforeand:afteralong with CSS 2.1counterfunction that can have it’s number list stylized so that no jQuery wrapper is needed. In fact, the jsFiddle revision shows the numbers using Google @font-face font.Using the CSS counter function is done by declaring a variable name to use in the
ulelement, then incrementing the counter in the:beforeelement as well as using it as actual content.Simple Example: jsFiddle CSS Counter
HTML:
CSS:
More about CSS counters HERE.
My original dated answer that uses existing framework in OP’s question is shown below.
I looked at your Question carefully and then looked at your webpage.
Here is the solution you need:
jsFiddle
To summarize, this are the replacement CSS Rules that make it work:
Result:

Extra: This variant example emphasizes the numbers: jsFiddle