简体   繁体   English

修复了带有可滚动导航栏的标题和不在浏览器视口下方的内容

[英]Fixed header with scrollable navbar and content that does not go below browser viewport

I am trying to create a layout that has a fixed header that always shows at the top. 我正在尝试创建一个具有固定标题的布局,该标题始终显示在顶部。 Additionally a side bar that will have a scroll bar next to it if the content goes past the browser height. 另外还有一个侧栏,如果内容越过浏览器高度,它旁边会有一个滚动条。 Same with the content to the right of the side-bar, I would like it to have its own scroll bar that does not go past the browser height. 与侧栏右侧的内容相同,我希望它有自己的滚动条,不会超过浏览器高度。

Please see this site for an example of what I am looking for. 请查看此站点以获取我正在寻找的示例。 It has all 3 features. 它具有所有3个功能。

I have tried so many things. 我尝试了很多东西。 Without the fixed header I can get it working by simply making everything height: 100%. 如果没有固定的标题,我可以通过简单地制作高度:100%来实现它。 But with the fixed header something is going on where the sidebar and content pane scroll bars go way below the browser view. 但是使用固定标题时,侧边栏和内容窗格滚动条会在浏览器视图下方显示。

I feel like I am getting somewhere when I add padding-bottom: 64px; 当我添加padding-bottom时,我觉得我到了某个地方:64px; to the items I want to have the scroll bar. 到我想要滚动条的项目。 The 64px is the height of the header. 64px是标题的高度。

Please go through the documentation and tutorial of Bootstrap and you will be able to do it. 请仔细阅读Bootstrap的文档和教程,您将能够做到这一点。

For reference go through this JSFiddle: https://jsfiddle.net/jxo6pmju/12/ 如需参考,请参阅此JSFiddle: https ://jsfiddle.net/jxo6pmju/12/

link = https://jsfiddle.net/jxo6pmju/12/

For scrollbar go through this : https://jsfiddle.net/vrzjLc77/1/ 对于滚动条,请执行以下操作: https//jsfiddle.net/vrzjLc77/1/

link = https://jsfiddle.net/vrzjLc77/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM