scss 当固定标头导致偏移时,Mixin固定锚点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss 当固定标头导致偏移时,Mixin固定锚点相关的知识,希望对你有一定的参考价值。

.anchor-offset-setup(@offset) {
    h2[id]::before,
    h3[id]::before,
    h4[id]::before,
    h5[id]::before,
    h6[id]::before {
        display: block;
        content: "";
        padding-top: (@offset + 10);
        margin-top: -(@offset + 10);
    }
    a[name]:empty,
    a[id]:empty {
        display: inline-block;
        content: "";
        padding-top: (@offset);
        margin-top: -(@offset);
    }
}

以上是关于scss 当固定标头导致偏移时,Mixin固定锚点的主要内容,如果未能解决你的问题,请参考以下文章