K
K
kim1232020-05-08 03:29:53
css
kim123, 2020-05-08 03:29:53

How to remove all before, after pseudo-elements from the page on button click?

How to remove all before, after pseudo-elements from the page on button click?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rustam Bainazarov, 2020-05-08
@kim123

Add a .no-pseudo class to the body with the following rule:

.no-pseudo:before,
.no-pseudo:after,
.no-pseudo *:before,
.no-pseudo *:after {
   content: none !important;
   display: none !important;
}

JS can’t work with pseudo-elements directly and fully, because these are not DOM elements, so that’s the only way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question