<div style="width:500px;position:absolute;left:200px;top:100px;border:1px solid red;height:100px" >
        <div id="px1" style="position:absolute; left:0px;height:100px; width:150px; background-color:green;"></div>
        <div id="px2" style=" height:100px;margin-left:150px;margin-right:150px;background-color:red;"></div>
        <div id="px3" style="position:absolute; top:0px;right:0px;height:100px; width:150px; background-color:gray;"></div>
    </div>

花了好几个小时。。各种问题,事实证明,Body有带margin,而父元素需要absolute, px3的top需要指定为0,否则会下去100px,然后终于OK

posted on 2015-06-14 22:30  MAINTAIN  阅读(341)  评论(0编辑  收藏  举报