Bootstrap: affix navigation blocking scroll-to section title

烈酒焚心 提交于 2019-12-11 14:18:30

问题


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.

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.

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

Any thoughts?


回答1:


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; }


来源:https://stackoverflow.com/questions/13184409/bootstrap-affix-navigation-blocking-scroll-to-section-title

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!