由Jekyll从Markdown生成的HTML中移动锚标签

时间:2015-01-22 18:32:38

标签: html css markdown jekyll

我正在处理的网站顶部有一个固定的导航栏。这会弄乱锚标签的位置。我知道这个问题的standard solution,但我不确定如何在这里应用它。

Markdown来源:

Go to [closing notes](#closing-notes).

### Closing Notes

Jekyll生成的HTML:

<p>Go to <a href="#closing-notes">closing notes</a>.</p>

<h3 id="closing-notes">Closing Notes</h3>

任何想法都非常感激。

1 个答案:

答案 0 :(得分:0)

我发现this post中概述的方法D在我的案例中运作正常,因为我不需要border-topmargin-top

h3 {
    border-top: 50px solid transparent;
    margin-top: -50px;
}