关于div的内容不和div一起移动的问题请教,也就是div3的position设置

代码:

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>t4</title>
        <style>
            * {
                margin: 0px;
                padding: 0px;
            }

            #div1 {
                width: 100px;
                height: 100px;
                border: 1px solid black;
                background-color: red;
                float: left;
            }

            #div2 {
                width: 100px;
                height: 100px;
                border: 1px solid black;
                background-color: yellow;
                float:left;
            }

            #div3 {
                width: 100px;
                height: 100px;
                border: 1px solid black;
                background-color: blue;
                position:relative;/*absolute*/
                top:100px;
            }
        </style>
    </head>
    <body>

        <div id="div1">1111111111</div>
        <div id="div2">2222222222</div>
        <div id="div3">3333333333</div>
    </body>
</html>

position=fixed 就不随着动了,你是这个意思吗?

不懂要问什么。。absolute不占位,脱离文档流

看你的div大小,,可以设置padding ,,margin属性,,position的absolute绝对定位和relative相对定位可以设置div的位置,