Is there any way to (robustly) reset any possible :after
and :before
CSS rules for a newly created element?
Usually you can just set the style rules you want to reset on the element directly (with !important
if you want to be sure), but I don't know of any way of changing rules defined in :after
on the element only.
(Only has to work with Chrome, if at all possible.)
An example at jsFiddle.
The content added with the :before
/:after
rules is affecting the value returned by clientHeight
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…