counter incrementer

PHOTO EMBED

Tue May 28 2024 23:21:01 GMT+0000 (Coordinated Universal Time)

Saved by @davidmchale #counter #css

ol.custom-ordered-list{
       counter-reset: list-counter; /* Initialize the counter */
        list-style: none; /* Remove default list styling */
        padding-left: 0; /* Remove default padding */       
    li{
            counter-increment: list-counter; /* Increment the counter */
            position: relative; /* Positioning for the pseudo-element */
            padding-left: 60px; /* Space for the counter */
            padding-bottom: 12px;
            line-height: 30px;
            left: 0;
        
        &:before{
            content: counter(list-counter, decimal-leading-zero) ""; /* Display the counter with leading zeros */
            position: absolute; /* Position it absolutely within the list item */
            left: 0; /* Align it to the left */
            width: 2em; /* Width for the counter */
            text-align: right; /* Align text to the right */
            font-size: 24px;
            font-weight: bold;
            color: #2E844B;
        }
    }
}
content_copyCOPY