[英]Apply CSS rule to all future elements
I'm making a simple Chrome extension for personal use. 我正在制作一个简单的Chrome扩展程序供个人使用。 I want to apply a CSS rule to all elements that match a class, even if they are rendered dynamically at some point after my extension's script is executed.
我想将CSS规则应用于与类匹配的所有元素,即使它们在执行扩展脚本后的某个时刻动态呈现。 How can I do this in RAW javascript?
如何在RAW JavaScript中做到这一点?
CSS rules will match any current and future elements in your document. CSS规则将匹配文档中任何当前和将来的元素。 The style gets applied as the document changes.
样式随着文档的更改而应用。
HTML5Rocks has a great article to give you a nice overview of how browsers work , including when and why layout and styling is applied. HTML5Rocks上有一篇很棒的文章,可以使您很好地概述浏览器的工作方式 ,包括何时以及为何应用布局和样式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.