【问题标题】:Exclude one particular image from img {display: none; }从 img {display: none; }
【发布时间】:2014-05-06 00:01:03
【问题描述】:

我已将img {display: none; } 添加到我的样式表中,但我想从该 CSS 规则中排除一个图像(徽标),因为我仍然希望我的徽标出现在页面上。我该怎么做?

【问题讨论】:

  • 为其添加一个 ID 并使用该 ID 选择该特定图像。
  • 这个问题似乎离题了,因为 OP 无法理解基本的 CSS 选择器是如何工作的。

标签: css image border


【解决方案1】:

那个特定的图像

<img id="id1"/>

CSS:

#id1
{
    display:inline-block; ie. other than none
}

【讨论】:

    【解决方案2】:

    试试这样:

    img:not('#logo'){ 显示:无; }

    【讨论】:

      猜你喜欢
      • 2014-07-25
      • 1970-01-01
      • 1970-01-01
      • 2017-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-04
      • 2017-02-10
      相关资源
      最近更新 更多