问题
With Javascript it is possible to stop propagation with code? E.g.
function func1(event) {
alert("DIV 1");
if (document.getElementById("check").checked) {
event.stopPropagation();
}
}
Is it also possible to stop propagation by CSS?
回答1:
Sort-of, in some browsers. You can use the 'all' property to reset an element back to initial values. That should mean the initial values inherit down from there.
Unfortunately it's not supported by IE and Edge though. https://www.caniuse.com/#search=all
来源:https://stackoverflow.com/questions/54764298/is-it-possible-to-stop-propagation-by-css