博客文字增加背景色块

  • 文字配置效果如下:

站点配置文件
主题配置文件
站点配置文件
主题配置文件

  • 打开themes/next/source/css/_custom 下的 custom.styl 文件,添加属性样式
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
// 颜色块-黄
span#inline-yellow {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #f0ad4e;
}
// 颜色块-绿
span#inline-green {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #5cb85c;
}
// 颜色块-蓝
span#inline-blue {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #2780e3;
}
// 颜色块-紫
span#inline-purple {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #9954bb;
}
  • 在你需要编辑的文章地方。放置如下代码
    1
    2
    3
    4
    <span id="inline-blue"> 站点配置文件 </span>
    <span id="inline-purple"> 主题配置文件 </span>
    <span id="inline-yellow"> 站点配置文件 </span>
    <span id="inline-green"> 主题配置文件 </span>
本文结束啦感谢您的阅读

本文标题:博客文字增加背景色块

文章作者:Smartfoot

原始链接:http://blog.bestsmartfoot.top/2018/06/23/article-3/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

公众号