最佳答案
将两个div的高度设置为相同
<div class="announcement" style="position: relative; width: 728px; height: 200px;"> <!--This is the containing div position: relative to flow in sequence with the rest of the page.-->
<div class="announcement" style="position: relative; width: 728px; height: 200px;">
<div style="position: absolute; top: 70px; left: 255px; width: 240px; background-color: azure;">
position: absolute; top: 70px; left: 255px; width: 240px; background-color: azure; overall width 248px including 2*3px padding and 2*1px border; (no height)
</div>
例如将固定此 div 的高度,无论 div 中是否有一行或 5 行或任何此高度都将保持不变。
PK
关于html - 不能让两个 div 的高度相等!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3860413/