【发布时间】:2012-11-30 06:11:32
【问题描述】:
我正在使用top: -50px; 将一个 div(div2 覆盖在 div1)重叠起来以将其向上推。现在这会在下一个 div (div3) 之前在其下方留下 50px。我怎样才能“清除”它并使 div (div3) 正好落在我定位 -50px 的 div (div2) 下方?
<div id="div1" style="width: 1000px; height: 90px; background: red;"></div>
<div id="div2" style="position: relative; top:-50px; width: 1000px; height: 90px; background: blue;"></div>
<!--50 wasted pixels here-->
<div id="div3" style="width: 1000px; background: green; height:90px;"></div>
【问题讨论】:
标签: css