Skip to content

Commit d0eeb91

Browse files
committed
sidebar 增加 sticky
1 parent 89fc5c6 commit d0eeb91

File tree

2 files changed

+17
-11950
lines changed

2 files changed

+17
-11950
lines changed

docs/index.html

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
padding-left: 15px;
1616
padding-right: 15px;
1717
}
18+
19+
.sidebar div {
20+
position: sticky;
21+
position: -webkit-sticky;
22+
top: 40px;
23+
list-style: none;
24+
padding: 0;
25+
margin: 0;
26+
}
1827
</style>
1928

2029
<body>
@@ -115,12 +124,14 @@ <h2 id="font-weight" class="border-b-1 border-b-solid border-gray-200 py-5 font-
115124
</div>
116125
</div>
117126
<div class="sidebar col-3">
118-
<h3 class="font-bold pl-2 text-2xl mt-5">Category</h3>
119-
<ul>
120-
<li v-for="item in menus" class="p-2 border-b border-gray-200">
121-
<a :href="`#${item.toLowerCase()}`">{{item}}</a>
122-
</li>
123-
</ul>
127+
<div>
128+
<h3 class="font-bold pl-2 text-2xl mt-5">Category</h3>
129+
<ul>
130+
<li v-for="item in menus" class="p-2 border-b border-gray-200">
131+
<a :href="`#${item.toLowerCase()}`">{{item}}</a>
132+
</li>
133+
</ul>
134+
</div>
124135
</div>
125136
</div>
126137
</main>

0 commit comments

Comments
 (0)