2011-02-14 25 views
1

的div'over'元素我試圖在頁面的特定點處的頁面下方繪製div。我想讓div在元素下面繪製,而不是在頁面頂部繪製所有其他元素。繪製可能低於

目前我的就是這個效果..

_________________ 
|  |   | 
|DIV |   | 
|  |   | 
|_____|   | 
|    | 
|    | 
| CONTENT  | 
|    | 
|_______________| 

我要的是..

_________________ 
|  |   | 
| DIV | CONTEN | 
|  |   | 
|_____|   | 
|    | 
|________________| 

我將如何實現這一目標?下面是我目前擁有的div的造型......

#laydiv{ 
margin:10px; 
background:url(../lightbg.jpg); 
border: 3px solid #fff; 
width: 500px; 
height:auto; 
position: fixed; 
float:left; 
left: 0pt; 
top: 0px; 
z-index: 2000000000; 
/* CSS3 styling for latest browsers */ 
-moz-box-shadow: 2px 2px 10px #000; 
-webkit-box-shadow: 2px 2px 10px #000; 
-moz-border-radius: 5px; 
-webkit-border-radius: 5px; 
} 

回答

1

如果使內格float:left;然後一切應該圍繞它包裝成你已經說明了。

<div style="width:220px;height:200px;border:1px solid red"> 
    <div style="float:left;width:50px;height:100px;border:1px solid green;margin-right:10px;">hello</div> 
    More content flows here<br />More content flows here<br />More content flows here<br />More content flows here<br />More content flows here<br />More content flows here<br />More content flows here<br /> 
</div> 
+0

嘗試向左浮動;沒有工作。 – Skizit 2011-02-14 12:19:55