Python学习记录W15-04:CSS内容补充之position(二)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <!--absolute:绝对定位-->
    <!--relative+absolute:相对定位-->
    <div style="position: relative;width:500px;height: 200px;border: 1px solid red; margin: 0 auto">
        <div style="position: absolute;left:0;bottom:0;width: 50px;height: 50px;background-color: black;"></div>
    </div>
    <div style="position: relative;width:500px;height: 200px;border: 1px solid red; margin: 0 auto">
        <div style="position: absolute;right:0;bottom:0;width: 50px;height: 50px;background-color: black;"></div>
    </div>
    <div style="position: relative;width:500px;height: 200px;border: 1px solid red; margin: 0 auto">
        <div style="position: absolute;right:0;top:0;width: 50px;height: 50px;background-color: black;"></div>
    </div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/up1292/article/details/82666626