现在的位置: 首页 > 综合 > 正文

Div 浮动到另一个div之上:

2013年10月25日 ⁄ 综合 ⁄ 共 456字 ⁄ 字号 评论关闭

Div 浮动到另一个div之上:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>绝对定位相对定位</title>
    <style>
        .fj1
        {
            position: absolute;
            width: 150px;
            height: 150px;
            border: 1px solid #000;
            background: #999;
        }
        .zj1
        {
            position: relative;
            width: 100px;
            height: 100px;
            border: 1px solid #F00;
            background: #FFF;
            z-index: 1;
        }
    </style>
</head>
<body>
    <div>
        <div class="fj1">
            我在下面 上的发生大幅 上的发生大幅随碟附送的
        </div>
        <div class="zj1">
            我浮动在上面</div>
    </div>
</body>
</html>

抱歉!评论已关闭.