0

ウェブサイトのフッターに問題があります。想定どおり、ページのコンテンツの後にレンダリングされますが、ページのコンテンツがブラウザーの高さよりも小さい場合、ページの中央に表示されるのは面倒です。

フッターを に手動で設定してこの動作を修正していますposition:absolute; bottom:0が、そうすると、コンテンツがブラウザーの高さよりも大きい場合にフッターが壊れます。これを自動化する方法はありますか?

コンテンツは単なる div であり、追加のスタイルはなく、通常、フッターはposition:relative; bottom:0. ウェブサイトはここで見ることができます: http://vestibulandos.oplex.com.br

ありがとう。

4

2 に答える 2

4

http://www.cssstickyfooter.com/をご覧ください。

于 2012-08-13T13:12:14.857 に答える
1
.wrapper {
margin: 0 auto -60px; /* the bottom margin is the negative value of the footer's height */
 }
 
/* FOOTER BOTTOM --------------------------------------------------------*/
 
.footer, .push {
    height: 60px; /* .push must be the same height as .footer */
}
 
#footer{
    position: relative;
    width: 100%;
    height: 60px;
}
于 2012-08-14T14:59:59.193 に答える