close

April 2024 only! Join our Discord free of charge.

Slick­Stack
Lightning-fast WordPress on Nginx

nice way to custom markers style, background color etc

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7617
    Brandon
    Guest

    I had to do this for a recent project guys, if you want to try its pretty cool, for example you don’t want to basic bullet discs or ordered list numbers, you want something custom like “Step 1, Step 2, etc” you can use this.

    ol > li:before {  
        margin-right: 10px;
        padding: 2px 10px;
        content:"Step " counter(list-item)" ";
        counter-increment: index;
        background-color: yellow;
    }
    
    ol li:first-child {
        counter-reset: index;
    }
    
    ol li {
        list-style-type: none;
    }
    #7618
    Henry
    Guest

    Technically this is not actually using the “marker” pseudo class

    cuz it doesn’t support background colors

    #7619
    Heather
    Guest
    #7620
    Amber
    Guest
    #7626
    Peter
    Guest

    verry nice, high five!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Thanks to our generous sponsors for their support!