1、如果对子元素施加绝对定位,然后设置一个bottom为20
则:
html
<div class="k1"><div class="k2">1111</div></div>
.k1 {margin: 0 auto;height: 500px;width: 500px;background: green;}.k2 {height: 100px;width: 100px;background: red;bottom: 20px;position: absolute;}
2、如果k1加上relative
则会显示
.k1 {margin: 0 auto;height: 500px;width: 500px;background: green;position: relative;}