Bootstrap:附加导航阻止滚动到部分标题 [英] Bootstrap: affix navigation blocking scroll-to section title

查看:53
本文介绍了Bootstrap:附加导航阻止滚动到部分标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有滚动间谍的侧滚动导航(我从引导程序中抓取),一切正常,除了部分标题在滚动到时被附加导航覆盖.

I have a side scrolling navigation with scroll spy (that I grabbed from bootstrap) and everything is working fine except that the section titles are being covered by the affixed navigation when scrolled to.

我在 scroll-spy.js 中有一个 75 的偏移量,但我不知道如何将内容向下推或告诉滚动焦点在每个部分的实际标题正上方,这样它们就不会被覆盖.

I have an offset of 75 in scroll-spy.js, but I am not sure how to push the content down or tell the scrolling to focus right above the actual title of each section so they aren't covered up.

你可以在url has been removed"中看到我在说什么

You can see what I am talking about at "url has been removed"

有什么想法吗?

推荐答案

向导航链接所针对的

元素添加顶部填充.

Add top padding to the <section> elements that your navigation links are targeting.

就您而言,您可以将其添加到样式表中:

In your case, you can just add this to your style sheet:

section { padding-top: 30px; }

这篇关于Bootstrap:附加导航阻止滚动到部分标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆