Note that there are some explanatory texts on larger screens.

plurals
  1. POdiv and span css styles for form buttons
    primarykey
    data
    text
    <p>I used the SO questions <a href="https://stackoverflow.com/questions/286275/gray-out-image-with-css">Gray out image with CSS?</a> and <a href="https://stackoverflow.com/questions/2091168/disable-a-link-using-css">Disable link using css</a> to construct a css wrapper that would grey out a button, and also prevent clicks to it. I tried first in a separate css file, but this example uses inline css styles and gives the same result. Here are 4 buttons:</p> <pre><code>&lt;!DOCTYPE html&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form&gt; &lt;span style="opacity:0.4; pointer-events: none;"&gt; &lt;input type='submit' value='Span Inside' /&gt; &lt;/span&gt; &lt;/form&gt; &lt;form&gt; &lt;div style="opacity:0.4; pointer-events: none;"&gt; &lt;input type='submit' value='Div Inside' /&gt; &lt;/div&gt; &lt;/form&gt; &lt;div style="opacity:0.4; pointer-events: none;"&gt; &lt;form&gt; &lt;input type='submit' value='Div Outside' /&gt; &lt;/form&gt; &lt;/div&gt; &lt;span style="opacity:0.4; pointer-events: none;"&gt; &lt;form&gt; &lt;input type='submit' value='Span Outside' /&gt; &lt;/form&gt; &lt;/span&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>All four buttons in this example do not respond to clicks in any of Firefox 15.0.1, Safari 6.0 or Chrome 21.0.1180.89, which is what I expected.</p> <p>In Firefox, all 4 buttons are greyed out, opacity 0.4, which is what I expected.</p> <p>In Safari and Chrome, the first 3 buttons are greyed out, but the 4th button, with the span elements outside the form elements, has opacity 1.0.</p> <p>Is there a bug in the browsers, or is it in in my understanding, please?</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