cssで①とか○の中に数字でol

html

1
2
3
4
5
6
7
<div class="crt_page">
<ol>
<li><a nohref="#" />aaa</a></li>
<li><a nohref="#" />ggg</a></li>
<li><a nohref="#" />zzz</a></li>
</ol>
</div>

css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ol {
  counter-reset: my-counter;
  list-style: none;
  padding: 0;
  margin: 0;
}
 
li {
display:inline-block;
  font-size: 16px;
  line-height: 1.5;
  padding-left: 30px;
  position: relative;
margin:0 10px
}
 
li:before {
  content: counter(my-counter);
  counter-increment: my-counter;
  background-color: #ff0000;
  border: 1px solid;
  border-radius: 50%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 22px;
  width: 22px;
  color: #ffffff;
  font-size: 85%;
  line-height: 1;
  position: absolute;
  top: 0;
  left: 0;
}

勉強させて貰ったサイト

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です