Note that there are some explanatory texts on larger screens.

plurals
  1. POMake Child div inside a certain-width parent div have full browser window width
    primarykey
    data
    text
    <p>I have a child div that needs to be a child of a parent div with a 1190px width and yet the child div needs to stretch the browser window. I am using <code>position: absolute; left: 0; right: 0;</code> to achieve this. </p> <p>Now the problem is that the content below my div overlaps under my absolutely positioned div since it's no longer in the box model. I could use margin bottom on the abs. positioned div, but it needs to be dynamic in the sense that the text inside it should be able to increase and decrease without me having to change any margins.</p> <p>I read that a <code>placeholder-div</code> might solve this. I have no idea how to do that. I tried an empty div on top of the absolutely positioned div with 'position: relative' but that did nothing.</p> <p><strong>HTML:</strong></p> <pre><code>&lt;div class="bonus-box"&gt; &lt;div class="container"&gt; &lt;span class="ribbon1"&gt;&lt;/span&gt; &lt;h3&gt;Bonus Scoring System&lt;/h3&gt; &lt;div class="list1"&gt; &lt;h4&gt;Royalities for Back Hands&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;&lt;span&gt;12 points for a Royal Flush&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span&gt;7 points or Straight Flush&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span&gt;4 points for Quads&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="list2"&gt; &lt;h4&gt;Royalities for Middle Hands&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;&lt;span&gt;24 points for a Royal Flush&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span&gt;14 points or Straight Flush&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span&gt;8 points for Quads&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span&gt;2 points for Full House&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="list3"&gt; &lt;h4&gt;Royalities for Front Hands&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;&lt;span&gt;3 point for a Three of a Kind&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- end bonus-box --&gt; &lt;div class="placeholder-div"&gt;&lt;/div&gt; &lt;h2&gt;Special Conditions&lt;/h2&gt; &lt;ul class="special-conditions"&gt; &lt;li&gt; &lt;strong&gt;1. Straights:&lt;/strong&gt; You need to have straight in the back hand - middle hand and have your top front hand in sequence. &lt;ol class="a-list"&gt; &lt;li&gt;Instant win and player wins 3 from everyone and voids all other hands.&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;li&gt; &lt;strong&gt;2. Flushes:&lt;/strong&gt; You need to have flushes in the back hand - middle hand and have your top front hand in the same suit. &lt;ol class="a-list"&gt; &lt;li&gt;Instant win and player wins 3 from everyone and voids all other hands.&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;li&gt; &lt;strong&gt;3. Six &amp;amp; Half Pairs:&lt;/strong&gt; You need to have six pairs in your hand. The last card can make three of a kind. &lt;ol class="a-list"&gt; &lt;li&gt;Instant win and player wins 3 from everyone and voids all other hands.&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;li&gt; &lt;strong&gt;4. 13 card wonder:&lt;/strong&gt;If you have no pairs in your hand which means you have all cards from A - 2 you get a special bonus. &lt;ol class="a-list"&gt; &lt;li&gt;Instant win and player wins 3 from everyone and voids all other hands.&lt;/li&gt; &lt;/ol&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- end content --&gt; </code></pre> <p><strong>CSS:</strong></p> <pre><code>.bonus-box { background: #3f3f3f; overflow: hidden; width: 100%; position:absolute; left:0; right:0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload