Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
渲染以PC浏览器为中心,但在iphone浏览器中不对齐_Iphone_Html_Css - Fatal编程技术网

渲染以PC浏览器为中心,但在iphone浏览器中不对齐

渲染以PC浏览器为中心,但在iphone浏览器中不对齐,iphone,html,css,Iphone,Html,Css,好的,我有一个中间的div用作页脚,它的名字是:由Coolname提供动力,样式是: #bottom-footer { width: 100%; height: 20px; position: absolute; bottom: 1px; text-align: center; } 在PC浏览器中显示ok: 但当你在iphone上试用时,它看起来是这样的: 显然没有居中,我做错了什么?看起来在包含的主体元素或div本身上有边距或填充。将此项添加到样式表以重置浏览器的自然行为: html {

好的,我有一个中间的div用作页脚,它的名字是:
由Coolname提供动力,样式是:

#bottom-footer {
width: 100%;
height: 20px;
position: absolute;
bottom: 1px;
text-align: center;
}
在PC浏览器中显示ok:

但当你在iphone上试用时,它看起来是这样的:


显然没有居中,我做错了什么?

看起来在包含
的主体
元素或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;
}

移除
宽度:100%

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