0

さて、私は単にフッターとして使用される中央の div を 1 つ持っています:<div id="bottom-footer">Powered by Coolname</div>とスタイル:

#bottom-footer {
width: 100%;
height: 20px;
position: absolute;
bottom: 1px;
text-align: center;
}

そして、それは PC ブラウザーで問題なくレンダリングされます。 ここに画像の説明を入力

しかし、iPhoneで試してみると、次のようになります。

ここに画像の説明を入力

明らかに中心ではありません。何が間違っていますか?

4

2 に答える 2

0

削除するwidth:100%

#bottom-footer {
height: 20px;
position: absolute;
bottom: 1px;
text-align: center;
}
于 2012-10-15T09:10:11.817 に答える
0

body含まれている要素または div 自体にマージンまたはパディングがあるように見えます。これをスタイル シートに追加して、ブラウザーの自然な動作をリセットします。

html {
margin:0px;
padding:0px;
}

body {
margin:0px;
padding:0px;
}

#bottom-footer {
width: 100%;
height: 20px;
position: absolute;
bottom: 1px;
text-align: center;
margin:0px;
padding:0px;
}
于 2012-10-15T08:54:31.657 に答える