typora代码块语言linux命令,Typora代码块配色和标题自带序号的实现代码

本文介绍了如何在Typora中实现标题自带序号和代码块的配色美化,包括通过编辑base.user.css文件添加相应CSS代码,以达到仿Mac图标的效果,同时提供了各代码段的详细解释。
摘要由CSDN通过智能技术生成

效果:标题自带序号,代码块配色,代码块左上角仿mac图标

8d5ddafda3cd4c85fb915e45459a6ee6.png

先打开主题文件夹

文件>偏好设置>外观>打开主题文件夹

然后编辑base.user.css(如果没有就新建一个)文件

将以下代码加入即可

/*标题自动添加序号*/

.sidebar-content {

counter-reset: h1

}

.outline-h1 {

counter-reset: h2

}

.outline-h2 {

counter-reset: h3

}

.outline-h3 {

counter-reset: h4

}

.outline-h4 {

counter-reset: h5

}

.outline-h5 {

counter-reset: h6

}

.outline-h1>.outline-item>.outline-label:before {

counter-increment: h1;

content: counter(h1) " "

}

.outline-h2>.outline-item>.outline-label:before {

counter-increment: h2;

content: counter(h1) "."counter(h2) " "

}

.outline-h3>.outline-item>.outline-label:before {

counter-increment: h3;

content: counter(h1) "."counter(h2) "."counter(h3) " "

}

.outline-h4>.outline-item>.outline-label:before {

counter-increment: h4;

content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) " "

}

.outline-h5>.outline-item>.outline-label:before {

counter-increment: h5;

content: counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) " "<

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值