如何覆盖伪元素上的CSS集合? [英] How do I override CSS set on a pseudo element?

查看:119
本文介绍了如何覆盖伪元素上的CSS集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道之前已经问过,但是我找不到清除这个CSS的方法:

I know that has been asked before, but I find no clean way of overriding this CSS:

.ui-input-search:after {
    content: "";
    height: 18px;
    left: 0.3125em;
    margin-top: -9px;
    opacity: 0.5;
    position: absolute;
    top: 50%;
    width: 18px;
}



我需要离开 ui-input-search ,但可以添加我自己的类,如:

I need to leave ui-input-search on the element, but can add my own class, like:

.ui-input-search-no-pseudo:after {
   content: "";
}

问题

有没有简单的方法来删除伪css,而不必重写CSS行一行?

Question:
Is there an easy way to remove "pseudo-css" without having to overwrite the CSS line by line?

谢谢!

推荐答案

据我所知,除了覆盖所有属性之外没有其他方法。样式是在元素上定义的,它们不会因为另一个选择器定位到元素而消失。

As far as I can tell there is no other way than to override all properties. The styles are defined on the element, they won't just disappear because of another selector that targets the element.

如果只想从页面中删除伪元素您可以 content:none

If you only want to remove the pseudo element from the page you can do content: none.

这篇关于如何覆盖伪元素上的CSS集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆