【问题标题】:opacity for table but dont want to apply that opacity in the div present inside td tag of the table [duplicate]表格的不透明度,但不想在表格的 td 标记内的 div 中应用该不透明度 [重复]
【发布时间】:2014-01-07 16:35:03
【问题描述】:

我正在为我的表格使用不透明度,但我不想在我提到的 div 中应用该不透明度,如何实现这一点?

<table  class="popup" style="background-color:#898989;
width:99%;  opacity:0.8;filter:alpha(opacity=80); >
    <tr>
      <td>
         <div>i dont want to apply transparency here</div>
      <td>
    </tr>
</table>

默认情况下,它在整个表格中应用透明度,这是我不想要的。

注意:我不能使用 RGBa,因为它与 IE7,8 不兼容

提前致谢。

【问题讨论】:

    标签: html


    【解决方案1】:

    编辑:

    抱歉之前的解决方案不正确。

    您可能想查看以下相关问题:

    I do not want to inherit the child opacity from the parent in CSS

    Resetting the opacity of a child element - Maple Browser (Samsung TV App)

    此链接说明了在使用 rgba 时如何将 better fallback 用于 ie6 and 7

    http://css-tricks.com/rgba-browser-support/

    【讨论】:

      【解决方案2】:
      <div style="opacity: 1;">i dont want to apply transparency here</div>
      

      【讨论】:

        【解决方案3】:

        你可以为你的背景使用 rgba 值

        <table  class="popup" style="background-color: rgba(137,137,137,0.8);
        width:99%;  >
            <tr>
              <td>
                 <div>i dont want to apply transparency here</div>
              <td>
            </tr>
        </table>
        

        【讨论】:

        • 我不能使用 RGBa,因为它与 IE7,8 不兼容
        • 您可以设置 1x1 像素的背景图像,颜色好作为后备
        • 我可以,但这不是我想要的
        • 使用 css3pie 怎么样? css3pie.com
        • 是的,我对此进行了搜索,但我想要一个 CSS 解决方案。
        【解决方案4】:

        如果您想要透明颜色或使用图像,请不要将不透明度应用于父元素使用 RGB 颜色。

        【讨论】:

        • 我不能使用 RGBa,因为它与 IE7,8 不兼容
        • 您可以在 ie 中使用,通过 css 过滤器检查这些链接,它们可能会有所帮助:) goo.gl/Zgy83H & goo.gl/Ri0bYp
        猜你喜欢
        • 1970-01-01
        • 2011-07-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-08-01
        • 2012-08-06
        • 2018-12-25
        • 1970-01-01
        相关资源
        最近更新 更多