butterfly主题文章段落标题美化
前言
在网上找了一些文章段落标题美化的文章,在这里汇总记录一下。
标题左侧显示美化
在custom.css(如果没有需要自己新建,并添加到对应的butterfly配置文件中,查看引入自定义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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64/* 文章页H1-H6图标 显示H1~H6 */
@-webkit-keyframes ccc {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
to {
-webkit-transform: rotate(-1turn);
transform: rotate(-1turn)
}
}
@keyframes ccc {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
to {
-webkit-transform: rotate(-1turn);
transform: rotate(-1turn)
}
}
#content-inner.layout h1::before {
color: #eaeaea ;
margin-left: -1.55rem;
font-size: 1.3rem;
margin-top: -0.23rem;
content:'H₁'
}
#content-inner.layout h2::before {
color: #eaeaea ;
margin-left: -1.55rem;
font-size: 1.1rem;
margin-top: -0.12rem;
content:'H₂'
}
#content-inner.layout h3::before {
color: #eaeaea ;
margin-left: -1.22rem;
font-size: 0.95rem;
margin-top: -0.09rem;
content:'H₃'
}
#content-inner.layout h4::before {
color: #eaeaea ;
margin-left: -1.05rem;
font-size: 0.8rem;
margin-top: -0.09rem;
content:'H₄'
}
#content-inner.layout h5::before {
color: #eaeaea ;
margin-left: -0.9rem;
font-size: 0.7rem;
margin-top: 0.0rem;
content:'H₅'
}
#content-inner.layout h6::before {
color: #eaeaea ;
margin-left: -0.9rem;
font-size: 0.66rem;
margin-top: 0.0rem;
content:'H₆'
}
标题右侧显示复制锚点按钮
butterfly自带锚点如果开启了话,当浏览文章到不同的锚点时,会出现大量的浏览历史记录,建议把这个功能关掉。但是在分享文章时,又希望能直接到达指定的段落,这时候就需要锚点复制的功能。
在custom.css(如果没有需要自己新建,并添加到对应的butterfly配置文件中,查看引入自定义css教程)文件中添加以下代码:1
2
3
4
5
6
7
8
9
10
11
12/* 文章页H1-H6图标 显示H1~H6 */
/*文章标题右侧显示锚点*/
#article-container.post-content .headerlink {
float: right;
font-size: 90%;
padding-top: 4px;
}
#article-container.post-content .headerlink::before {
content: '\f0c1';
font-family: "Font Awesome 6 Free";
}