Note that there are some explanatory texts on larger screens.

plurals
  1. POLink using z-index can't be clicked even though it's on top, in both Firefox & IE
    primarykey
    data
    text
    <p>I'm trying to get a text link to appear on top of a partly-transparent image, which in turn is on top of a plain coloured background. I want the link-text and image to print when the page is printed, but not the coloured background. (Which is why I'm not using the <em>background-image</em> property)</p> <p>The problem is that although the link appears on top of the image, and the image appears on top of the background as desired, the link cannot be clicked. It seems to me that if the link appears on top then it should be susceptible to mouse events... </p> <p>This happens in at least the following browsers: Firefox 6.0 (Windows + Linux), Firefox 3.6 (Windows) and Internet Explorer 7.</p> <p>Please would somebody tell me if this is a problem with my HTML/CSS, or with the browsers? </p> <p>Here is some HTML to demonstrate the problem: </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Test&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div style="position: relative;z-index: -2; background-color:#333; height:200px;"&gt; &lt;img style="position: absolute;top: 0;left: 0;z-index: -1;" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/280px-PNG_transparency_demonstration_1.png" alt="Dice" /&gt; &lt;a style="padding:50px; color:#fff;z-index:0;" href="#"&gt;Can you click me?&lt;/a&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Cheers!</p> <p>Alex</p>
    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.
 

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