<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>底部对齐</title>
<style>
#a{
margin: 0 auto;
width: 500px;
height: 500px;
background: #CCCCE7;
position: relative; /* 父级容器相对定位 */
}
#b{
width: 200px;
height: 200px;
background: green;
position: absolute; /* 相对于容器绝对定位 */
bottom: 0px; /* 距离容器底部0px,无论容器高度多少,
都距离底部0px */
}
</style>
</head>
<body>
<div id="a">
<div id="b"></div>
</div>
</body>
</html>