我有一个子 div,它需要是宽度为 1190px 的父 div 的子级,但子级 div 需要拉伸浏览器窗口。我在用position: absolute; left: 0; right: 0;
来实现这一点。
现在的问题是我的 div 下面的内容在我的绝对定位的 div 下重叠,因为它不再在盒子模型中。我可以在腹肌上使用边距底部。定位的 div,但它需要是动态的,因为它里面的文本应该能够增加和减少,而无需我更改任何边距。
我读到placeholder-div
可能会解决这个问题。我不知道该怎么做。我在绝对定位的 div 上尝试了一个空 div,带有“位置:相对”,但什么也没做。
HTML:
<div class="bonus-box">
<div class="container">
<span class="ribbon1"></span>
<h3>Bonus Scoring System</h3>
<div class="list1">
<h4>Royalities for Back Hands</h4>
<ul>
<li><span>12 points for a Royal Flush</span></li>
<li><span>7 points or Straight Flush</span></li>
<li><span>4 points for Quads</span></li>
</ul>
</div>
<div class="list2">
<h4>Royalities for Middle Hands</h4>
<ul>
<li><span>24 points for a Royal Flush</span></li>
<li><span>14 points or Straight Flush</span></li>
<li><span>8 points for Quads</span></li>
<li><span>2 points for Full House</span></li>
</ul>
</div>
<div class="list3">
<h4>Royalities for Front Hands</h4>
<ul>
<li><span>3 point for a Three of a Kind</span></li>
</ul>
</div>
</div>
</div>
<!-- end bonus-box -->
<div class="placeholder-div"></div>
<h2>Special Conditions</h2>
<ul class="special-conditions">
<li>
<strong>1. Straights:</strong> You need to have straight in the back hand - middle hand and have your top front hand in sequence.
<ol class="a-list">
<li>Instant win and player wins 3 from everyone and voids all other hands.</li>
</ol>
</li>
<li>
<strong>2. Flushes:</strong> You need to have flushes in the back hand - middle hand and have your top front hand in the same suit.
<ol class="a-list">
<li>Instant win and player wins 3 from everyone and voids all other hands.</li>
</ol>
</li>
<li>
<strong>3. Six & Half Pairs:</strong> You need to have six pairs in your hand. The last card can make three of a kind.
<ol class="a-list">
<li>Instant win and player wins 3 from everyone and voids all other hands.</li>
</ol>
</li>
<li>
<strong>4. 13 card wonder:</strong>If you have no pairs in your hand which means you have all cards from A - 2 you get a special bonus.
<ol class="a-list">
<li>Instant win and player wins 3 from everyone and voids all other hands.</li>
</ol>
</li>
</ul>
</div><!-- end content -->
CSS:
.bonus-box {
background: #3f3f3f;
overflow: hidden;
width: 100%;
position:absolute;
left:0;
right:0;
}