2013-08-22 22 views

回答

1

您不必使用插件:

-1-使用導航欄固定頂類導覽列,如div class="navbar navbar-default navbar-fixed-top"

-2-確保你的頁面有正確的結構(自舉三是):

<body> 

<!-- Wrap all page content here --> 
<div id="wrap"> 
page content here 
</div> <!-- end wrap --> 

<div id="footer"> 
    sticky footer here 
</div> <!-- end footer --> 

</body> 

-3- css是

html, 
body { 
height: 100%; 
/* The html and body elements cannot have any padding or margin. */ 
} 

/* Wrapper for page content to push down footer */ 
#wrap { 
min-height: 100%; 
height: auto !important; 
height: 100%; 
/* Negative indent footer by its height */ 
margin: 0 auto -60px; 
/* Pad bottom by footer height */ 
padding: 0 0 60px; 
} 

/* Set the fixed height of the footer here */ 
#footer { 
height: 60px; 
background-color: #f5f5f5; 
} 

就是這樣!請注意,CSS和頁面結構從Bootstrap 2有所變化

祝你好運!