2016-04-13 9 views
-1

私はページの一番下にフッターを貼り付けようとしています。ボトムを0pxに設定しましたが、ページが長すぎる場合は、ページの下部に表示されるのではなく、上部に表示されます。また、私のフッタは、ページの下部にあるのではなく、ロゴをつけています。この問題を解決するにはどうすればよいですか?フッターを下に置く

相続人一例 enter image description here CSS

.logo { 
    display: block; 
    z-index: 20; 
    height: 200px; 
    margin-left: auto; 
    margin-right: auto; 
    margin-top: 100px; 
} 

footer { 
    width: 100%; 
    background: rgba(0,0,0,0.6); 
    bottom: 0; 
} 

HTML

<footer class="footer"> 
     <div class="container text-center"> 
      <h4>Follow Us On Social Media!</h4> 
      <a href="#"><i class="fa fa-facebook-square fa-3x" aria-hidden="true"></i></a> 
      <a href="#"><i class="fa fa-twitter-square fa-3x"></i></a> 
      <a href="#"><i class="fa fa-google-plus-square fa-3x"></i></a> 
      <a href="#"><i class="fa fa-instagram fa-3x" aria-hidden="true"></i></a> 
     </div><!--End container--> 
    </footer><!--End footer 2--> 

あなたの助けに感謝!

+1

フッタ位置に入れる:[スティッキーフッターが底部に配置されていない]の固定 – misher

+0

可能な重複(http://stackoverflow.com/questions/14877482/を下に置かれたべたつきのフッターではない) –

答えて

0

htmlタグに位置相対プロパティを追加し、下に示すように絶対をフッターに配置すると、フッターは常にページコンテンツの一番下になります。

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

 
.logo { 
 
    display: block; 
 
    z-index: 20; 
 
    height: 200px; 
 
    margin-left: auto; 
 
    margin-right: auto; 
 
    margin-top: 100px; 
 
} 
 

 
.footer { 
 
    width: 100%; 
 
    background: rgba(0,0,0,0.6); 
 
    position:absolute; 
 
    bottom: 0; 
 
}

Check this Jsfiddle for reference