469,270 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Applying background color to ordered list numbers, NOT content

HaLo2FrEeEk
404 256MB
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
1 3428
HaLo2FrEeEk
404 256MB
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:

http://infectionist.com/extras/cshar...blf_struct.php

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.

Similar topics

4 posts views Thread by Ken Innes | last post: by
6 posts views Thread by Stephen Miller | last post: by
33 posts views Thread by Jim Cobban | last post: by
2 posts views Thread by Bosconian | last post: by
20 posts views Thread by shapper | last post: by
16 posts views Thread by some old html fumbler | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.