CSS - Style for list number

0 votes
244 views
added May 24, 2019 in CSS by LC Marshal Captain (25,770 points)
ol {
    // list-style: decimal;
    list-style: none;
    counter-reset: li;
    li {
        counter-increment: li;
        margin-left: 32px;
        .related-article {
            margin-bottom: 0;
            border-bottom: 0;
        }
        .line-breaker {
            border-bottom: 1px solid #d9d9d9;
            position: relative;
            left: -31px;
            width: 105%;
            @media (max-width: $break_m_lg) {
                width: 108%;
            }
            @media (max-width: $break_m_md) {
                width: 110%;
            }
        }
    }
    li::before {
        content: counter(li); 
        text-align: center;
        font-weight: 600;
        font-size: 30px;
        line-height: 0;
        position: relative;
        top: 33px;
        color: #228ffc;
        display: inline-block; 
        width: 1em;
        margin-left: -1.3em;
    }
}

 

1 Response

0 votes
responded Mar 26, 2020 by LC Marshal Captain (25,770 points)
.ol-number {
  list-style: none;
  counter-reset: li;
  margin: 0;
  padding: 0;
  li {
    counter-increment: li;
    margin-left: 32px;
  }
  li::before {
    content: counter(li);
    text-align: center;
    font-weight: 600;
    font-size: 30px;
    line-height: 0;
    position: relative;
    top: 33px;
    color: #488BF8;
    display: inline-block;
    width: 1em;
    margin-left: -1.3em;
  }
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...