Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As I stated in the comments, children inherit opacity from their parent. The <code>.ch-info</code> class inherits its opacity from <code>.logo</code>, so you cannot have the immediate parent be <code>.logo</code>. </p> <p>That being said, just have a <code>&lt;div class="logo"&gt;&lt;/div&gt;</code> before <code>.ch-info</code> that uses <code>position: absolute;</code>, is the same height as either the <code>&lt;td&gt;</code> or <code>.ch-info</code>, and has the desired background... However, you would have to use <code>position:relative;</code> on <code>.ch-info</code> so the <code>z-index</code> does not become a problem.</p> <p><em><strong>DEMO: <a href="http://jsfiddle.net/dirtyd77/mSg97/3/" rel="nofollow">http://jsfiddle.net/dirtyd77/mSg97/3/</a></em></strong></p> <p><strong>HTML:</strong></p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td width="160" height="160"&gt; &lt;div class="logo" style="background:blue;"&gt;&lt;/div&gt; &lt;div class="ch-info"&gt; &lt;h3&gt;Add New Deal&lt;/h3&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="160" height="160"&gt; &lt;div class="logo" style="background:red;"&gt;&lt;/div&gt; &lt;div class="ch-info"&gt; &lt;h3&gt;Add New Deal&lt;/h3&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="160" height="160"&gt; &lt;div class="logo" style="background:orange;"&gt;&lt;/div&gt; &lt;div class="ch-info"&gt; &lt;h3&gt;Add New Deal&lt;/h3&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p></p> <p><strong>CSS:</strong></p> <pre><code>.logo { width:160px; height:160px; position:absolute; opacity:0.3; filter:alpha(opacity=30); /* For IE8 and earlier */ background-repeat:no-repeat; background-position:center; } .logo:hover { opacity:0.8; filter:alpha(opacity=80); /* For IE8 and earlier */ } .ch-info { letter-spacing: 2px; font-size: 20px; /* margin: 0 30px; padding: 45px 0 0 0;*/ font-family: 'Open Sans', Arial, sans-serif; -webkit-text-stroke: 1px black; color: #d3d3d3; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; vertical-align:middle; text-align:center; position:relative; } </code></pre> <p>Let me know if you have any questions.</p> <hr/> <p><em><strong>EDIT:</em></strong> However, this situation seems better suited for jQuery. I have provided an example below.</p> <p><em><strong>DEMO: <a href="http://jsfiddle.net/dirtyd77/mSg97/4/" rel="nofollow">http://jsfiddle.net/dirtyd77/mSg97/4/</a></em></strong></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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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