有没有办法获得应用于HTML片段或页面的所有CSS的列表? [英] Is there a way to get a list of all the CSS applied to a HTML fragment or page?

查看:90
本文介绍了有没有办法获得应用于HTML片段或页面的所有CSS的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道使用像Firefox的Firebug扩展等工具可以轻松获得应用于HTML中单个节点的CSS。



但是一种可以查看整个页面或HTML的更大片段的CSS的方法

具体而言,我们正在清理将我们的一个非常大的CSS文件放到更小的模块中,并想找出在某个页面上使用了什么CSS,因此我们可以将所有未使用的CSS移动到另一个模块。

解决方案

谢谢大家!这些是我现在从你的建议中看到的各种解决方案(在这里收集的同样问题的人):

Dust-Me选择器(Firefox附加组件)

这正是我所需要的。列出已使用和未使用的CSS选择器(针对当前页面或整个站点,在抓取后),并且可以将这两个列表转储为CSV文本。很好。

https://addons.mozilla.org / firefox / addon / 5392 /

CSS使用(Firefox附加组件)

https://addons.mozilla.org/firefox/addon/10704/



WARI - Web应用程序资源检查器(Java工具)

似乎只处理静态代码,而不是动态生成的HTML在大多数使用ajax的web应用程序中都存在 - 至少对我来说这很不幸,至少对于我来说它是无用的

http://wari.konem.net/



CSS Redundancy Checker (Ruby脚本,需要Rubygems和Hpricot)

http://code.google.com/ p / css-redundancy-checker /



TopStyle (仅限Windows应用程序,$ 79.95(!!))

http:// svanas。 dynip.com/topstyle/



这些都是跨平台和免费的,除了TopStyle。


I know it's easy to get the CSS that is applied to a single node in HTML, using tools like the Firebug extension for Firefox, etc.

But is there a way to see all the CSS that is in effect on an entire page, or a larger fragment of HTML?

Specifically, we are cleaning up our one extremely large CSS file into smaller modules and would like to find out what CSS is used on a certain page, so we can move all the non-used CSS to another module.

解决方案

Thank you all! These are the various solutions I've looked at now from your recommendations (collected here for people with the same problem):

Dust-Me Selectors (Firefox Add-on)
This does exactly what I need. Lists used and unused CSS selectors (for the current page, or the entire site, after spidering), and can dump both lists as CSV text. Great.
https://addons.mozilla.org/firefox/addon/5392/

CSS Usage (Firefox Add-on)
https://addons.mozilla.org/firefox/addon/10704/

WARI - Web Application Resource Inspector (Java tool)
Appears to only handle static code, not dynamically generated HTML as is present in most web applications that use ajax – which, unfortunately, makes it useless, at least for me
http://wari.konem.net/

CSS Redundancy Checker (Ruby script, requires Rubygems and Hpricot)
http://code.google.com/p/css-redundancy-checker/

TopStyle (Windows-only application, $79.95 (!!))
http://svanas.dynip.com/topstyle/

These are all cross-platform and free, except for TopStyle.

这篇关于有没有办法获得应用于HTML片段或页面的所有CSS的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆