[removed] Advantages and disadvantages of dynamically (on fly) creating style element

后端 未结 3 1156
囚心锁ツ
囚心锁ツ 2020-12-30 09:36

In JavaScript we can create ...

The scoped attribute makes the contained styles only valid for its containing element, the table in this case, and of course all its contained elements. And since you can access it by ID the contents are easily replaced/reconstructed.

While this would be preferable to your approach, as long as there's no universal browser support for this creating style elements in the head is the best workaround.

提交回复
热议问题