2009-06-11 64 views
2

我剛做完該網站,但仍然存在一個愚蠢的錯誤......CSS位置變化/問題

,如果您檢查整個頁面的能恩水平位置有輕微的轉變......沒什麼哭但爲什麼

這裏是2頁

http://jlecologia.com/index.php

http://jlecologia.com/entreprise.php

任何想法,日e橫向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!

回答

4

當不需要垂直滾動條時,擴展瀏覽器的視口。由於您的設計是水平居中的,因此在視口擴展時居中會發生移位。這是Cha-cha Cha的原因(並且不要讓你的舞蹈教師以不同的方式告訴你)。

如果你感到強烈的它,您可以強制垂直滾動條始終顯示是這樣的:

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

+1嗨,真的很好的解決方案。但對於IE6滾動條已經存在,如果內容少。謝謝 – 2009-06-11 18:56:39

4

與更多的內容頁對右邊的滾動。

因爲你有一個水平居中的頁面,帶滾動條的頁面的寬度會變窄幾個像素,導致居中部分左移。