首頁 > 後端開發 > php教程 > 如何讓一個DIV浮動在另一個DIV上面

如何讓一個DIV浮動在另一個DIV上面

WBOY
發布: 2016-07-29 09:15:59
原創
1723 人瀏覽過

 

直接上DEMO了

<span><!</span><span>DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"</span><span>></span><span><</span><span>meta </span><span>http-equiv</span><span>="Content-Type"</span><span> content</span><span>="text/html; charset=gb2312"</span><span>/></span><span><</span><span>style </span><span>type</span><span>="text/css"</span><span>></span><span><!-- 
.d1 </span><span>{</span><span>        position</span><span>:</span><span>absolute</span><span>;</span><span>        top</span><span>:</span><span>20px</span><span>;</span><span>        left</span><span>:</span><span>20px</span><span>;</span><span>        width</span><span>:</span><span>200px</span><span>;</span><span>        height</span><span>:</span><span>200px</span><span>;</span><span>        background</span><span>:</span><span>red
        </span><span>}</span><span>.d2 </span><span>{</span><span>        width</span><span>:</span><span>500px</span><span>;</span><span>        height</span><span>:</span><span>100px</span><span>;</span><span>        background</span><span>:</span><span>blue</span><span>;</span><span>}</span><span>
-->
</span><span></</span><span>style</span><span>></span><span><</span><span>div </span><span>class</span><span>="d1"</span><span>></</span><span>div</span><span>></span><span><</span><span>div </span><span>class</span><span>="d2"</span><span>></</span><span>div</span><span>></span>
登入後複製

以上就介紹如何讓一個DIV浮動在另一個DIV上面,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板