Chrome Developer Tools: inspect prettified CSS

旧街凉风 提交于 2019-12-22 06:23:20

问题


If you want to look at the CSS of other people's websites (to steal learn from them), Firebug lets you inspect the prettified CSS:

But in Chrome 16, you only get the minified CSS as it was served out:

Is there a way to get Chrome to prettify the CSS?


回答1:


In the newer versions there is a "format" button that prettifies the source:

(only just realised myself :P )




回答2:


The Developer's console shows the file as served. If you want a human-readable version, copy-paste the code to http://www.codebeautifier.com/.

If you use the Elements tab, the applied CSS properties are also shown per element.




回答3:


I recommend Quick Source Viewer, which is an extension to chrome and requires no human copy-pasting (acts sort of like an extra chrome dev-tool). It can show you the source of the current page formatted and colour coded.

It's pretty powerful, showing all 'sources' of the page, be it css, js or html. Even things like inline css/js can be viewed individually (with injected code highlighted). And the best part is it prettifies all of them, even the css (which chrome's dev tools still refuses to do).




回答4:


You may want to checkout Pretty Print: https://chrome.google.com/webstore/detail/prettyprint/nipdlgebaanapcphbcidpmmmkcecpkhg?hl=en

After installing, when you view a minified CSS or JS file, it will appear (after a moment) un-minified.



来源:https://stackoverflow.com/questions/8173905/chrome-developer-tools-inspect-prettified-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!