2011-02-14 28 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