Note that there are some explanatory texts on larger screens.

plurals
  1. POIE 7 - when opacity is set for DIV with position absolute it's child divs disappear
    primarykey
    data
    text
    <p>I have a div with position set to absolute and a few divs inside of that. As soon as I add an opacity filter to that div even if opacity is set to 100 the child divs disappear in IE7. </p> <p>The same thing happens if I change the opacity via jQuery even without position absolute.</p> <p>Does anybody know a fix?</p> <p>Thank you in advance</p> <p>Example</p> <pre><code>&lt;style type="text/css"&gt; #wrap { opacity: 0.5; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter: alpha(Opacity=50); -moz-opacity: 0.50; -khtml-opacity: 0.5; position:absolute; } #sub1 { position:absolute; width:200px; height:200px; background-color:#F00; } &lt;/style&gt; &lt;div id="wrap"&gt; &lt;div id="sub1"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>If wrap has opacity and position absolute, sub1 is invisible in IE7</p> <p>Second scenario:</p> <pre><code>#wrap { position:absolute; width:500px; height:500px; color:#fff; filter: alpha(Opacity=100); } #sub1 { position:absolute; } #sub2_bg { width:500px; height:500px; background-color:#000; position:absolute; filter: alpha(Opacity=50); } #sub2_text { position:absolute; } &lt;/style&gt; &lt;div id="wrap"&gt; &lt;div id="sub1"&gt; &lt;div id="sub2_bg"&gt;&lt;/div&gt; &lt;div id="sub2_text"&gt;sample text&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>In that scenario the text "sample text" inside sub2_text has an alpha transparency of 50% as soon as wrap has a filter even if it is opacity=100. Obviously I could remove alpha(opacity=100) but the same problem appears when I animate the opacity of wrap to .5 and back up to 1, because then the div gets a filter. I noticed that only the parts that have an alpha transparent div below that have this issue, if the text was larger than sub1_bg only the parts on top of sub1_bg would be affected. Again only in IE 7.</p> <p>Would be nice if someone could show me a fix for that too. Thank you.</p>
    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.
 

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