<ol class="cp_clist">
<li>css</li>
<li>html</li>
<li>copy</li>
<li>easy</li>
</ol>
ol.cp_clist {
padding: 0;
counter-reset:cp_clist; /*数字をリセット*/
list-style-type: none;
}
ol.cp_clist li {
position: relative;
min-height: 30px;
padding: 2px 10px 2px 30px;
margin: 0 0 10px 0;
background: #9FA8DA;
color: #333;
border-radius: 5px;
transition: all .3s ease-out;
}
ol.cp_clist li::before{
position: absolute;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
/* カウントさせる */
counter-increment: cp_clist;
content: counter(cp_clist);
/*装飾*/
background: #3F51B5;
color: #fff;
height: 28px;
width: 28px;
border: 3px solid #fff;
border-radius: 50%;
/*位置の調整*/
padding: 0;
margin: 0 0 0 -20px;
transition: all .3s ease-out;
}
/*hover時の設定*/
ol.cp_clist li:hover{
background: #C5CAE9;
}
ol.cp_clist li:hover::before{
left: 10px;
transform: rotate(360deg);
}