HOME> 本届世界杯> 【已解决】如何设置7级以上标题?

【已解决】如何设置7级以上标题?

有一個方法,在obsidian-quiet-outline的大綱中,可以讓7-12級標題顯示出不同的顏色和縮進。在floating-toc中,也可以有類似的效果。 比如下面的文本...

有一個方法,在obsidian-quiet-outline的大綱中,可以讓7-12級標題顯示出不同的顏色和縮進。在floating-toc中,也可以有類似的效果。

比如下面的文本,

# level 1

## level 2

### level 3

#### level 4

##### level 5

###### level 6

###### # level 7

###### ## level 8

###### ### level 9

###### #### level 10

###### ##### level 11

###### ###### level 12

snippets中用下面的css:

/* 大綱7-12級 quiet-outline, floating-toc */

.n-tree-node-content__text :is(h1,h2,h3,h4,h5,h6) {

margin: 0px !important;

font-weight: 100 !important;

font-size: calc(var(--font-text-size) * 0.45) !important;

}

.text-wrap.heading-rendered :is(h1,h2,h3,h4,h5,h6){

margin: 0px !important;

font-weight: 100 !important;

font-size: calc(var(--floating-toc-font-size) * 1.0) !important;

background: var(--floating-toc-header-background-color);

padding: 0px 10px !important;

border-radius: 14px !important;

}

.text-wrap.heading-rendered.located :is(h1,h2,h3,h4,h5,h6,.text) {

font-weight: 900 !important;

background: #d5fdc6 !important;

}

.heading-list-item.located :is(h1,h2,h3,h4,h5,h6,.text){

color: #ff0000!important;

font-weight: 900 !important;

background: #feddc5 !important;

}

:is(.located) :is(.n-tree-node-content__text) :is(h1,h2,h3,h4,h5,h6) {

color: #ff0000!important;

font-weight: 900 !important;

}

:is(.n-tree-node-content__text, .text-wrap.heading-rendered) h1{

margin-left: 10px !important;

}

:is(.n-tree-node-content__text, .text-wrap.heading-rendered) h2 {

margin-left: 20px !important;

}

:is(.n-tree-node-content__text, .text-wrap.heading-rendered) h3 {

margin-left: 30px !important;

}

:is(.n-tree-node-content__text, .text-wrap.heading-rendered) h4 {

margin-left: 40px !important;

}

:is(.n-tree-node-content__text, .text-wrap.heading-rendered) h5 {

margin-left: 50px !important;

}

:is(.n-tree-node-content__text, .text-wrap.heading-rendered) h6 {

margin-left: 60px !important;

}

.floating-toc{

top: 45px !important;

}

.floating-toc-div .toolbar{

top: 25px !important;

}

.heading-list-item {

min-height: 28px !important;

}

.heading-list-item .text-wrap .text{

padding: 0px 10px 0px 10px !important;

}

.heading-list-item[data-level="6"] .text::after{

padding: 0px 5px !important;

}

顯示結果是這樣:

12級標題|5001138×1203 64.5 KB

13級以後的,可以每六級加一個空格。這樣,在引用標題時,不會帶入#等其它字符。


全面指南:如何高效地升级您的旧电脑 奇迹射手攻略介绍