2013-02-13 171 views
0

導航到以前的註釋時隱藏內容溢出,請參閱鏈接。溢出隱藏 - 錨鏈接溢出內容

實施例: http://justfortest.cba.pl/misc/index.html(全內容顯示) http://justfortest.cba.pl/misc/index.html#comment-3(內容被切割成錨鏈接)

我發現,當我除去溢出:隱藏;從.content> div然後內容不溢出,但然後設計被破壞:與背景和太長的div問題。

刪除溢出後:隱藏; (問題與div長度和背景)。 justfortest.cba.pl/misc/index2.html#comment-3

更新時間:

下面是內容的一部分代碼:

.content {padding: 40px 0; border-top: 5px solid #e3e4e6; border-bottom: 1px solid #d8d8d8; background: url("images/bg.png");} 
.content>div { width: 980px; margin: 0 auto; border: 1px solid #d8d8d8; background: #fff;} 
.main {float: left; overflow: hidden; width: 610px; margin-bottom: -5000px; padding: 15px 35px 5030px;} 
.sidebar {float: right; width: 260px; margin-bottom: -5000px; padding: 15px 19px 5030px; border-left: 1px solid #e8e8e8; background: #fafbfc;} 

請您與問題幫助嗎?

任何幫助將不勝感激。

親切的問候

+0

您好Newbie1,歡迎SO。請閱讀此:http://meta.stackexchange.com/questions/80978/questions-linking-to-external-web-sites-instead-of-showing-code和此:http://meta.stackexchange.com/questions/125997 /我的網站上的東西不工作,我可以只是粘貼鏈接到它 – 2013-02-13 14:47:03

+0

嗨,感謝您的鏈接,我無法添加圖像,因爲需要大於10的聲望。我用w3c檢查了html和style,沒有發現嚴重錯誤。我還用CSS代碼更新了問題中的內容。我還能做些什麼嗎? – Newbie1 2013-02-13 15:07:04

回答

1

試試這個

.main { 
    float: left; 
    margin-bottom: 0; /* from -5000px */ 
    overflow: hidden; 
    padding: 15px 35px 30px; /* from 15px 35px 5030px */ 
    width: 610px; 
} 
+0

您的'margin-bottom:-5000px'似乎在某種'Pee-ka-boo'錯誤中排除了頁面。此外,DOM無法計算整個頁面高度..你是否從特定的錨點#哈希顯示。 – 2013-02-13 15:36:22

+0

嗨,我試過你的代碼,但它沒有幫助。還是有同樣的問題。 – Newbie1 2013-02-13 16:38:03

+0

我將我的.main類替換爲您放在上面的.main類。 – Newbie1 2013-02-13 16:44:43