I\'m trying to create an ordered list in CSS + HTML that looks like this:
I can\'t for the
content:counter(li) with increment doesn't work in my less so I found some wokraround:)
li {
position: relative;
line-height: 2.5em;
list-style-type: none;
&:before{
content: '';
position: absolute;
left: -29px;
top: 7px;
display: block;
background: @btn-bg-secondary;
width: 20px;
height: 20px;
border-radius: 50%;
color: @bg-color-primary;
padding-left: 7px;
line-height: 1.5em;
}
&:nth-child(1):before{
content: '1';
}
&:nth-child(2):before{
content: '2';
}
&:nth-child(3):before{
content: '3';
}
&:nth-child(4):before{
content: '4';
}
&:nth-child(5):before{
content: '5';
}
&:nth-child(6):before{
content: '6';
}
&:nth-child(7):before{
content: '7';
}
&:nth-child(8):before{
content: '8';
}
}
http://jsfiddle.net/du6ezxj7/