开发者

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

开发者 https://www.devze.com 2023-03-08 20:34 出处:网络
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

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

精彩评论

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

关注公众号