【问题标题】:Undo pseudo element ::before and ::after rules [duplicate]撤消伪元素 ::before 和 ::after 规则[重复]
【发布时间】:2012-08-31 19:19:06
【问题描述】:

可能重复:
Is there any way to reset :after/:before CSS rules for an element?

有没有一种巧妙的方法来撤消元素上的所有 ::before 和 ::after 伪元素规则?我想删除使用 Twitter 引导样式的下拉菜单上的箭头效果。我是否必须一一取消设置每条规则,还是可以通过其他方式将其清除?例如

.navbar .nav > li > .dropdown-menu::after {
position: absolute;
top: -6px;
left: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
border-left: 6px solid transparent;
content: '';
}

【问题讨论】:

  • 如何设置显示:无;或显示:none!important;?
  • 你应该可以只设置content:none; 并且不会有任何CSS样式。

标签: css pseudo-element


【解决方案1】:

http://jsfiddle.net/LQTmF/

<selector>:after{
    content:none;
}

【讨论】:

  • 啊,那行得通。我认为没有一个等同于“”,它已经设置为,但没有:) 谢谢
  • noneNULL 的 CSS 等价物。空字符串仍然是字符串,不是吗? ;)
  • 这是真的,我应该知道的更好:( 头晕
猜你喜欢
  • 2018-10-06
  • 2011-08-14
  • 2012-05-31
  • 2020-09-20
  • 2011-04-02
  • 1970-01-01
  • 2015-09-12
  • 1970-01-01
  • 2014-01-28
相关资源
最近更新 更多