Applying background color to ordered list numbers, NOT content

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HaLo2FrEeEk
    Contributor
    • Feb 2007
    • 404

    Applying background color to ordered list numbers, NOT content

    I need to know how / if it's possible to apply a background color to a ordered list item's numbers, and not the content itself. I've tried:

    Code:
    ol {
       background-color: #FFFF00;
       }
    But that does the opposite, applies the background color to the list's contents, but not the numbers. I'm making a syntax highlighting script that shows line numbers and I need to be able to clearly separate the line numbers from the code.

    Can someone help me achieve this please?
  • HaLo2FrEeEk
    Contributor
    • Feb 2007
    • 404

    #2
    That's much more elegant than my solution, but it doesn't work in IE7. My logs show I'm still getting a decent number of visits from IE7 users. Here's the page with my solution:

    Own this domain today. We make your shopping experience easy. Friendly and quick customer service.


    It even works on my Android phone.

    Comment

    Working...