-1

这个 Wordpress 站点通常在浏览器中居中对齐,iPad 上的 Safari 除外。在 iPad 上,该站点奇怪地左对齐(左侧没有空格)。

我已经在其他(非 iPad)浏览器上测试过了,不能重复这个问题。

iPad截图:在此处输入图像描述

网址:http ://rainleader.com

我不知道是什么原因造成的。几乎所有东西都有一个 CSS 宽度值......

有什么我想念的吗?

4

1 回答 1

2

你有这个:

body { font-size: 13px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #111; background-image: url('http://cdn.rainleader.com/assets/bg_top_outer.jpg'); background-repeat: repeat-x; text-align:center; }
#container { width: 900px; margin-top: 25px; margin-right: auto; margin-left: auto; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }

改成这个

body { [add this] text-align:center }
[change to this] #container { width: 900px; margin-top: 25px; margin: 0 auto; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;  text-align:left; }

这就是我始终以事物为中心的方式,并且始终有效。

1)在正文中对齐中心(你没有这样做)

2)容器中的margin 0 auto(你只有auto,没有0)

3)在容器中指定宽度

4)在容器中左对齐以从主体撤消中心

于 2013-01-26T08:14:57.173 回答