子div在父div中置底

来源:互联网 发布:迅雷下载for mac 编辑:程序博客网 时间:2024/04/27 22:01
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>子div在父div中置底</title>
    <style type="text/css">
        .father { width: 500px; height: 600px; position: relative; background-color: AliceBlue; }
        .child { width: 100%; height: 100px; position: absolute; bottom: 0; background-color: AntiqueWhite; }
    </style>
</head>
<body>
    <div class="father">
        <div class="child">
        </div>
    </div>
</body>
</html>