wordpress支持在自定义额外CSS,这样我们就无需改动主题里的源文件即可轻松调整网页的外观。分享一个自用的代码。
定义字体、字号1
body {font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "Hiragino Sans GB", "WenQuanYi Micro Hei", sans-serif;
font-size:16px;}
标题
.entry-title, .widecolumn h2 {
font-size: 28px;
font-weight:600;
}
.entry-content h3 {
font-size: 20px;
}
.entry-content h4, .entry-summary h4, .page-content h4, .comment-content h4 {
font-size: 18px;
}
代码格式2
.wp-block-code {
display: block;
font-size: 14px;
line-height: 22px;
overflow-x: auto;
white-space: pre;
word-wrap: normal;
border-radius: 4px;
padding: 8px;
color: #abb2bf;
background: #282c34;
}
2020.2.29所用font-family
Lato,pingfang sc,microsoft yahei,sans-serif;
目前网站使用的font-family
font-family: -apple-system, SF UI Text, PingFang SC, Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro Hei, Arial, sans-serif;
参考文献
- 达芬奇密码 .中文网页字体的最佳选择[OL]https://sq.163yun.com/blog/article/176137697898717184
- https://www.csdn.net/
- koreyhan. 如何优雅的选择字体(font-family) https://segmentfault.com/a/1190000006110417