0

私はこれを機能させる方法を試しました。主にこのソリューションを試しています。

それは私にはうまくいきませんでした。私が目にする問題は、ボディの html css で、高さを 100% に設定しているが、実際には 100% に設定していないことです。

これが私のフッターと本文、html の CSS コードです。

body {
font-family: 'AG-Regular', Helvetica, Arial, sans-serif;
margin: 0;
min-width: 1058px;
}

body, html {
height:100% !important;
}

#footerBox {
    width: 100%;
height:218px;
background-image:url(/img/footer-bg.png);
background-attachment:scroll;
background-repeat:repeat-x;
}

サイトへのリンクはこちらです

どこが壊れているかわかるはずです。どんな助けでも感謝します。ありがとう。

4

2 に答える 2

1

ヘッダーとフッターを貼り付けるには、両方で position: fixed を使用する必要があります。

サンプルコード

ヘッダ

#headerBox
{
    position: fixed;
    height: 200px;
    left: 0;
    top: 0;
    width: 100%;
}

主要

#mainBox
{
    overflow: auto;
}

フッター

#footerBox
{
     postion: fixed;
     height: 218px;
     width: 100%;
     bottom: 0;
     left: 0;
}    
于 2013-03-27T15:11:56.923 に答える
0

主な問題はでし-218px margin-bottom#maincontent。フッター218pxが押し下げられるようにします。を使用してフッターを常にページの下部に配置するように設定しましたが、position: fixedこれが必要かどうかはわかりません。

#footerBox {
width: 100%;
height: 218px;
background-image: url(/img/footer-bg.png);
background-attachment: scroll;
background-repeat: repeat-x;
position: fixed;
bottom: 0;
}
#mainBox #mainContent {
background-color: white;
margin: 185px auto 218px;
overflow: auto;
padding: 30px 20px 20px;
width: 958px;
}
于 2013-03-27T15:03:46.463 に答える