CSS位置变化/问题

时间:2009-06-11 13:00:34

标签: css position

我刚刚完成那个网站,但仍有一个愚蠢的错误......

如果你检查整个页面的水平位置有一个轻微的转变...没什么好哭但是为什么

这是2页

http://jlecologia.com/index.php

http://jlecologia.com/entreprise.php

任何想法,横向css是:

#wrapper {
    position:relative; /* center, not in IE5 */
    width:856px;
    top: 38px;
    margin-top: 0;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    display: block;
    padding: 0px;
}

我不喜欢我的页面来做cha-cha-cha!

2 个答案:

答案 0 :(得分:4)

当不需要垂直滚动条时,将扩展浏览器的视口。由于您的设计是水平居中的,因此当视口扩展时,居中将会移动。这就是cha-cha-cha的原因(不要让你的舞蹈教练告诉你不同)。

如果您对此感到强烈,可以强制垂直滚动条始终显示如下:

html { min-height: 100%; margin-bottom: 1px; }
* html { height: 100%; } /* for ie 6 */

答案 1 :(得分:4)

包含更多内容的页面右侧有滚动条。

因为你有一个水平居中的页面,带滚动条的页面宽度会缩小几个像素,导致居中部分向左移动。

相关问题