创建CSS:之后用jQuery [英] Creating CSS :after with jQuery
本文介绍了创建CSS:之后用jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要为我的元素动态创建我的CSS样式。但是,我需要有:在CSS之后,我听说你不能在jQuery中修改这个。
I need to dynamically create my CSS styles for my elements. However, I need to have :after in CSS and I have heard that you cannot modify this in jQuery.
这是真的吗?有没有办法解决?
Is this true? Is there anyway around this?
推荐答案
您可以生成< style>
到< head>
:
$("head").append($('<style>div:after { content: " World" }</style>'));
这篇关于创建CSS:之后用jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文