标签:back absolute position height border ack col relative ati
<div style="position: relative;width:800px;height: 300px;background-color: gainsboro;border:1px solid red;margin: 0 auto"> <div style="position: absolute;width:100px;height: 100px;bottom: 0;left: 0;background-color: brown"> </div> </div> <div style="position: relative;width:800px;height: 300px;background-color: gainsboro;border:1px solid red;margin: 0 auto"> <div style="position: absolute;width:100px;height: 100px;top: 0;right: 0;background-color: brown"> </div> </div> <div style="position: relative;width:800px;height: 300px;background-color: gainsboro;border:1px solid red;margin: 0 auto"> <div style="position: absolute;width:100px;height: 100px;bottom:0;background-color: brown"> </div> </div>
当需要下层DIV在上层DIV中定位时,上层DIV使用relative,下层DIV使用absolute.配合TOP,LEFT,RIGHT,BOTTOM定位。
标签:back absolute position height border ack col relative ati
原文地址:http://www.cnblogs.com/GabyGU/p/7786861.html