开发者

How do I export dom values of element to css file equivalent

I have element that are being dynamically updated and开发者_如何学C I want to generate a css file which contains the rendered styles for that element. Is there anything that does this? Thanks.


There is nothing I know of in jQuery or JavaScript that does this intrinsically. However, if you just want it for yourself and not for dynamically creating stylesheets, then I recommend Firefox and the Firebug plugin. This will show you the CSS live and you can modify and export it, as well.


getComputedStyle gives you the computed style of an element:

window.getComputedStyle($("#my_element").get(0))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜