Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Coloring the List-Style-Type for an Ordered List

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #250645
    joshdraha
    Participant

    I can’t for the life of me figure out how to color JUST the square list icon in an ordered list. Every code I try colors the square AND the test. All I want is the square to change to color #f05a23. Any help would be awesome!

    ol {
    list-style-type: square;
    margin-left: 0;
    padding-left: 1em;
    }

    #250657
    Atelierbram
    Participant

    Wrapping the text in in the list-items in span‘s can work, but I don’t know if you can touch the HTML for this thing.

    http://codepen.io/atelierbram/pen/LxOJxw

    #250681
    Chris Coyier
    Keymaster

    As a fork of @Atelierbram’s Pen, another method is to remove the list-style and apply the square via pseudo content.

    http://codepen.io/chriscoyier/pen/oBoJLr

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.