Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is your padding. The link at the top is still clickable because the <code>margin</code> on your content displaces it, meaning that your element is no longer covers your link when the user has scrolled to the correct place. With the <code>padding-bottom</code> the element is extended and the element covers the links at the bottom. The solution is therefore found when considering the problem: <em>how do we extend where the page can scroll to without using <code>#contentWrapper</code>?</em></p> <p>Here's one solution which <em>works regardless of the height of your content</em>:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; #top, #bottom { position: fixed; background-color: #00F; left: 100px; padding: 8px; } #top { top: 0; } #bottom { bottom: 0; } #contentWrapper { position: absolute; margin: 100px 0 0 0; width: 600px; z-index: 10000; overflow: visible; } #heightFix { position: absolute; bottom: -100px; height: 0; overflow: hidden; font-size: 0; } #content { background-color: #F00; height: 1000px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="top"&gt;&lt;a href="#"&gt;Top link&lt;/a&gt;&lt;/div&gt; &lt;div id="bottom"&gt;&lt;a href="#"&gt;Bottom link&lt;/a&gt;&lt;/div&gt; &lt;div id="contentWrapper"&gt; &lt;div id="heightFix"&gt;&lt;/div&gt; &lt;div id="content"&gt;Some content&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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