0

I need to be able to add a purple circle background and change the color of just the number in an ol li decimal html element.

Is that possible without any extra markup? I've tried backgrounds, list-style-image etc etc, but none seem to so that.

Any ideas?

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
John
  • 833
  • 1
  • 11
  • 24

1 Answers1

2

I use another span element to format the background of each li numer. You can view the demo here on JSBin

Hieu Le
  • 8,288
  • 1
  • 34
  • 55
  • Based on your example, I've shortened the code by using the `:before` pseudo element - you can **[view it here](http://jsbin.com/abamat/5/edit)**. Sadly, this doesn't answer the question from John, since he doesn't want any extra markup. – MarcoK Jan 21 '13 at 11:10
  • I think i'm going to go with adding the span as it would give the most cross compatibility. I know i said i didn't want more markup, but looking at this, i don't think i have a choice. Thanks for the answers guys!! – John Jan 21 '13 at 11:13