簡體   English   中英

始終定位下頁腳

[英]Position bottom footer always

我有頁腳,但Google地圖有問題。

 <table class="sortable table table-bordered table-responsive " id="table"  ng-show="bsalInfo">
    <tbody>
        <tr ng-repeat="att in bsalInfo track by $index">
               <td>{{att.name}}</td>
        </tr>
    </tbody>
</table>

開始這個腳本我的谷歌地圖

<div class="col-md-12" >
    <div id="map" style="width:100%;  height: 60%; position: absolute;margin-top: 45px;">
        <div id="map"></div>
    </div>
</div>

完成此腳本我的谷歌地圖

這個CSS頁腳

footer{
    position: relative;
    bottom: 0 ;
    margin-left: auto;
    margin-right: auto;
    width: 100%;

}

我的問題在哪里? 1.我的頁腳在地圖上,我希望頁腳始終在頁面上。 2當頁腳頁面上的滾動條始終坐下時,無論頁面上有多少結果。

我希望頁腳位於頁面底部,但不固定

的HTML

<html>
   <head></head>
   <body>        
      <div id="header"></div>
      <div id="content"></div>
      <div id="footer"></div>     
   </body>
</html> 

的CSS

html {
      height: 100%;
    }

body {
  position: relative;
  margin: 0;
  min-height: 100%;  
  padding: 0;
}

#header {
  background: green;
  height: 90px;
}

#footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 90px;
  background-color: red;
}

看來您的代碼中沒有顯示任何元素<footer> 但是,如果您希望頁腳始終停留在頁面底部,請使用position: fixed; 連同bottom: 0; 和你的其他樣式

在這里閱讀

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM