盒子定位

position定位参数,配合参数left、right、top、bottom

HTML代码

<body>

    <div></div>

</body>

CSS代码

div{

    position:absolute;

    lft:100px;            //right:200px;  left、right不可同时出现

    top:200px;           //bottom:200px;  一般情况不设置底bottom

    width:100px;

    height:100px;

    background-color:red;

}

猜你喜欢

转载自www.cnblogs.com/xibuhaohao/p/10342772.html