By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,680 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,680 IT Pros & Developers. It's quick & easy.

Applying background color to ordered list numbers, NOT content

P: 404
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:

Expand|Select|Wrap|Line Numbers
  1. ol {
  2.    background-color: #FFFF00;
  3.    }
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?
Jun 8 '10 #1
Share this Question
Share on Google+
1 Reply

P: 404
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:

It even works on my Android phone.
Jun 9 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.