Results 1 to 4 of 4

Thread: Number color on ordered list?

  1. #1
    Join Date
    Feb 2003
    Aberdeen, Washington, USA

    Number color on ordered list?

    Hey everybody,
    I'm working with ordered lists and I was wondering if it's possible to make the numbers a certain color. I know you can just add color: #000; to the li in the CSS but that colors the numbers and the list content as well. I want it to just color the numbers. Is this possible? I've looked around and couldn't find anything so I'm guessing it's not but I thought I would ask here for a final confirmation.

    Thanks for any help you guys can provide.

  2. #2
    Join Date
    Apr 2003
    Wrap the contents of the li in a span and give that a diferent color.
    li {color:#red;}
    li span {color:#black;}

  3. #3
    Join Date
    Nov 2003
    The numbers in an ordered list automatically inherit the color attribute in the CSS for that list. You could put the text inside the list-item inside a span, and color the span, though.

    Oh damnit! Fang is too fast!
    Windows XP SP2 - theme: Thallos
    AMD Athlon 64 X2 4600+ | ASUS M2N32-SLI Deluxe | 2 * 1024 PC2-6400 Mushkin DDR2-800 | eVGA GeForce 6800XT 256MB | Creative Sound Blaster X-FI Music
    5 * 320GB Seagate Barracuda SATA-II 3Gb/s in RAID 5 | Lite-On 16x DVD-RW | Mitsumi 7-in-1 Floppy drive and card reader
    Samsung SyncMaster 204B 20" TFT LCD | Logitech G15 Keyboard | Logitech G7 Mouse | Seasonic PC160SK Headset

  4. #4
    Join Date
    Feb 2003
    Aberdeen, Washington, USA
    Quoted from Fang's profile
    Resistance is futile

    Thanks much guys. Thats exactly what I needed.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles