【问题标题】:Prevent css "content" being applied to specific element防止将 css“内容”应用于特定元素
【发布时间】:2015-09-21 22:01:23
【问题描述】:

我的 wordpress css 中有这个:

.widget-area ul li:before {
  position: absolute;
  font-family: FontAwesome;
  content: "\f105";

不幸的是,我现在想在不应用“>”内容的情况下向小部件区域添加一些内容……我似乎无法理解。我已经尝试过初始,没有,我只是不知道我做错了什么,不幸的是我还不熟悉“内容”或继承。

.decent-comments ul li:before {
  position: absolute;
  font-family: FontAwesome;
  content: none!important;
}

这是标签云下右侧最近的 cmets 内容: http://www.nextlevelsmf.com/news/

【问题讨论】:

  • 从这里开始工作。可能是缓存问题?
  • 你没看到这个? i61.tinypic.com/20jmeex.jpg
  • 我以前看过。但是当我通过 Firebug 添加 CSS 时。它已被删除。
  • CSS 已在文件中,但未显示。对于所有其他小部件,我仍然想要那个顶部的小部件,而不是这个。

标签: css wordpress twitter-bootstrap-3


【解决方案1】:

由于媒体查询使用不正确,该图标可见。你可以在这里了解更多信息:MDN Docs

如果您想在屏幕上使用媒体查询,请使用only

@media not all { // Remove the not or use `only screen` or don't use the media query at all
  .decent-comments ul li::before {
    content: initial !important;
    font-family: FontAwesome;
    position: absolute;
  }
}

【讨论】:

  • 谢谢!!我也是媒体查询的新手哈哈。慢慢来!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-15
  • 1970-01-01
  • 2015-10-24
  • 2012-06-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多