【发布时间】:2012-09-03 15:32:22
【问题描述】:
这是我的布局的简化:
<div style="position: relative; width:600px;">
<p>Content of unknown length, but quite quite quite quite quite quite quite quite quite quite quite quite quite quite quite quite long</p>
<div>Content of unknown height</div>
<div class="btn" style="position: absolute; right: 0; bottom: 0; width: 200px; height: 100px;background-color: red;"></div>
</div>
我遇到的问题是,如果文本/未知 div 内容太长,它会与我的绝对定位 div 重叠。
我已经在网上搜索了一个解决方案,我发现唯一一个建议在绝对定位的 div 所在的位置放置一个不可见的 div - 问题是如果我能做到这一点,我就不需要在第一名(或者我错过了这里的重点)。
在我走 jquery 路线之前,谁能想到一个 css 解决方案?
【问题讨论】:
-
在 jsFiddle 上展示你的问题。我复制粘贴了您的示例(还向 .btn 添加了尺寸和背景),长内容似乎没有“重叠”按钮 jsfiddle.net/gzSGM