js-动态修改伪元素样式

Posted 面包_girl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了js-动态修改伪元素样式相关的知识,希望对你有一定的参考价值。

 document.styleSheets[0].addRule(‘#‘ + node.key + ‘::after‘, ‘height:‘ + fileNameDom.clientHeight + ‘px !important‘); // 设置伪元素样式

document.styleSheets[0].addRule(‘.className‘或‘#ID’ +‘::after’,css样式字符串拼接).

以上是关于js-动态修改伪元素样式的主要内容,如果未能解决你的问题,请参考以下文章