I tried to add a table of contents (TOC) to my Github pages by following:
post.md:
* TOC
{:toc}
main.css:
#markdown-toc ul {
list-style: bullets;
depth: 1;
}
#markdown-toc {
border: 1px solid #aaa;
padding: 1.5em;
list-style: decimal;
display: inline-block;
}
It works like
enter image description here
However, I want the TOC to be compact rather than have extra space like the space above Sec 2. Any way for that? Besides, I am not very familiar with css. What other attributes does markdown-toc have?
Any advices will be appreciated!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…