Command Palette

Search for a command to run...

HTML 锚点偏移方法 防止被头部遮挡

由于顶部菜单存在 position:fixed ,而引起的的锚点位置偏移。 在css中,给锚点添加偏移量,直接就可以了 html { scroll-padding-top: 200px; scroll-behavior: smooth; } 就是这么简单的办法,我不知道为什么百度搜不出来 其他不是用正负边距进行抵消,就是用js写滚动。 网络上的反面教材: .content { margin-top...