html - Bootstrap 固定导航栏、粘性页脚、动态缩放内容

标签 html css twitter-bootstrap

我要实现this example但不同之处在于,如果我的页面上有太多内容(在导航栏和页脚之间),则此内容会被缩小/压缩以适合内部(即如此页脚在所有屏幕分辨率下仍然可见,使其成为 CSS 行话中的“固定页脚”)。我正在使用 bootstrap 3.1.1,如果有人有 bootstrap 友好的解决方案,那就太好了 :)。最好!

最佳答案

您始终可以使用固定页脚,并在其下方滚动任何其他内容。 这是一个jsfiddle举个例子:

html { 
  min-height: 100%;
  position: relative;
}

body {
  margin-bottom: 1.5rem /* or whatever your fixed footer height is */
 }

/* and assuming your footer has id="footer"  */
#footer { 
   position: fixed;
   bottom: 0;
   height: 1.5rem;
   overflow: hidden;
   }

关于html - Bootstrap 固定导航栏、粘性页脚、动态缩放内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23410600/

相关文章:

html - CSS 中的扩展中间层

html - 如何使用 list-group-horizo​​ntal (bootstrap 4) 删除 <ul> 之间的空白区域?

html - 外部 CSS 文件无法正常工作

html - 这是 Bootstrap 中的错误吗?

javascript - Html 表文本条目占位符作为行索引

PHP 或 Javascript :Check if cookie is set, 如果它是改变 <li> 的内容

css - 如何隐藏侧边栏列表中的元素符号?

javascript - 如何在 D3.js 中的图表上设置 slider 样式并显示动态 y 值标签?

javascript - Bootstrap 可扩展侧边栏元素

css - 关于 Glyphicon 错误的建议?