【问题标题】:How to overide an inline style [duplicate]如何覆盖内联样式[重复]
【发布时间】:2015-02-10 01:19:22
【问题描述】:

这是我的风格

<section id="text-13" class="widget widget_text">
    <div class="widget-wrap">           
        <div class="textwidget">
            <div style="background-color:#f7f6f6; padding: 15px;">
                <div align="center">
                    <h2>Junte-se a mais de 4.137 assinantes:</h2>
                </div>

如何在不编辑文件的情况下通过 CSS 覆盖 div style = background。

【问题讨论】:

  • div class="widget-wrap">
  • div class="widget-wrap">
  • 那个编码是干什么用的?顺便说一句,它无效:&gt;div class="widget-wrap"&gt;

标签: css


【解决方案1】:

据此CSS Tricks Article

.textwidget div[style] {
   background: yellow !important;
}

【讨论】:

    【解决方案2】:

    你可以使用 !important

    .textwidget > div {背景:无!重要}

    【讨论】:

      猜你喜欢
      • 2019-04-11
      • 1970-01-01
      • 1970-01-01
      • 2016-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-24
      • 2010-10-02
      相关资源
      最近更新 更多