我想要一个父类(ul
标签)来保存一堆li
相互重叠的标签,这是我的代码:
<ul class="overlap">
<li>
Overlap One
</li>
<li>
Overlap Two
</li>
<li>
Overlap Three
</li>
</ul>
我不希望它们被绝对定位,因为我有一个具有背景边框和颜色的父元素,但是当我绝对定位子元素时,父元素不会拉伸,这是完整的代码。
<blockquote>
<ul class="overlap">
<li>
Overlap One
</li>
<li>
Overlap Two
</li>
<li>
Overlap Three
</li>
</ul>
</blockquote>
标签上有背景颜色,这blockquote
就是为什么孩子不能绝对定位的原因。
在此先感谢您的帮助!