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

时间:2014-05-01 15:14:31

标签: html css twitter-bootstrap

我希望实现this example但不同之处在于,如果我的网页上有太多内容(在导航栏和页脚之间),则此内容缩小 /挤压以适应内部(即,使得页脚在所有屏幕分辨率下仍然可见,使其成为CSS术语中的“固定页脚”)。我正在使用bootstrap 3.1.1,如果有人有一个可以自助运行的解决方案,那将会很酷:)。最好!

2 个答案:

答案 0 :(得分:1)

您可以随时使用固定的页脚,并在其下方滚动任何其他内容。 以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;
   }

答案 1 :(得分:0)

请参阅此回答here,以及它引用here的示例。如果你有照片和一切,我会假设有点不同。如果您可以在jsFiddle上提供您的内容示例,我们可以帮助您更好地扩展它。

相关问题