2012-02-05 47 views
0

這裏的「脊樑」結構中的站點鏈接:http://www.vomow.net讓一個div是在多個格

基本上是我需要的就是把中心的網頁,在同一高度上一個div,但800像素寬度。該div需要沒有背景。 我試過用「z-index」但沒有任何運氣。

有人可以幫忙嗎?

+0

查看是誰給你的第一個幫助你的答案 - 然後將其設置爲你接受的答案。 – ParPar 2012-02-05 13:10:04

回答

0

一些代碼將是有益的,但我認爲你應該使用:

left: 50%; 
margin-left: -400px; //this is because your div's width is 800px 
1

我想在你的網站:

element.style { 
    margin-left: auto; 
    margin-right: auto; 
    width: 800px; 
} 

position: absolute; 

要使用絕對位置使用中心的div

它有幫助。

祝你好運!

0

如果你只是想中心一個div,你可以這樣做:

#myDiv { width: 800px; margin-left: auto; margin-right: auto; }

但我不知道是否要在此div來介紹一些你在頂部的那些。在這種情況下,您可以使用position: relative;,然後調整top屬性。

#yourdiv{ 
margin: 0px auto; 
width:800px; 
} 

好運:

0

如下:這也可以寫!