Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a way to have element behind a div (links) clickable in areas where the div is "transparent"
    primarykey
    data
    text
    <p>I have a block element that is positioned absolutely and some other elements on page that are positioned fixed. The effect is the block on top floats over the page which works well.</p> <p>The links in the elements at the bottom underneath are not clickable. They shouldn't be when the content of the div is over them, but when the "marginal" areas which are transparent are over the links they are visible, but clicks only register to the covering div.</p> <p>The problem only happens when the padding covers the div. But if I just rely on the margin the bottom margin is ignored by browser so the scroll doesn't go high enough up. To solve this I resort to padding at the bottom. This is the problem.</p> <p>Is there a clean way around this? I realize I could have the underneath elements doubled and place on top, but opacity set to 0. That is an undesirable solution however.</p> <p>Sample of the problem:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'&gt; &lt;head&gt; &lt;style&gt; #top, #bottom { position: fixed; border: 1 px solid #333; background-color: #eee; left: 100px; padding: 8px; } #top { top: 0; z-index: 1; } #bottom { bottom: 0; z-index: 2; } #contentWrapper { position: absolute; margin: 100px 0 0 0; /* Padding is used to make sure the scroll goes up further on the page */ padding: 0 0 100px 0; width: 600px; z-index: 3; } #content { border: 1 px solid #333; background-color: #eee; 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='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.
    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.
    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