2013-07-29 82 views
-1

我想打一個網站的頁腳是這樣的:如何使用一個div創建頁腳?

A shaded area, showing boxes left and right, and a circle sticking up out of the area in the centre.

這裏是我到目前爲止有:

<footer><div class="box1"></div><div class="logo"></div><div class="box2"></div></footer> 

footer { width:100%; height:auto;background:#CCC;} 
.box1 {width:33%; height:100px; background:#F04; } 
.box2 {width:33%; height:100px; background:#F04;} 
.logo {width:33% height:150px; background:#F03} 
+1

一個只有HTML

Live

+0

的社區#1旨在幫助那些真正卡住上的問題,但我們不會把努力爲您編寫代碼,以便我們看不到自己已經付出了任何努力。請將您的代碼與您已經嘗試過的內容一起發佈,我們可能會爲您提供幫助。 –

+1

對不起.a創建演示與我的實際代碼http://jsfiddle.net/GRktb/ – Live

回答

1

我有爲您演示了一個小提琴,演示您正在尋找的結果。

EXAMPLE

請注意,爲了讓這個正常工作,你需要有一個透明的形象,改變取決於圖像大小的空間。

HTML

<footer> 
    <div class="box1"></div> 
    <div class="logo"> 
     <image src="http://www.clker.com/cliparts/C/m/c/J/g/l/white-round-md.png" /> 
    </div> 
    <div class="box2"></div> 
</footer> 

CSS

footer { 
    margin-top:200px; 
    width:100%; 
    height:110px; 
    background:grey; 
} 
.box1 { 
    width:31%; 
    margin-left:1%; 
    margin-right:1%; 
    margin-top:5px; 
    margin-bottom:5px; 
    height:100px; 
    background-color:#cccccc; 
    float:left; 
} 
.box2 { 
    width:31%; 
    margin-left:1%; 
    margin-right:1%; 
    margin-top:5px; 
    margin-bottom:5px; 
    height:100px; 
    background:#cccccc; 
    float:left; 
} 
.logo { 
    width:auto; 
    margin-left:2%; 
    margin-right:2%; 
    margin-top:5px; 
    margin-bottom:5px; 
    height:100px; 
    float:left; 
} 
.logo img { 
    height:250px; 
    margin-top: -150px; 
} 
相關問題