Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
嗨,我猜你的意思是美化它,
对于 javascript :
http://jsbeautifier.org/
对于CSS:
http://www.codebeautifier.com/
hi I guess you mean beautify it ,
for javascript :
http://jsbeautifier.org/
for css :
http://www.codebeautifier.com/
我喜欢这个网站来重新格式化/美化 CSS:
http://procssor.com/
I like this website for reformatting/prettifying CSS:
http://procssor.com/
我现在使用 Chrome 进行日常开发...如果您也有同样的情况,请使用 PrettyPrint 扩展程序 非常适合这一点。
您可以使用缩进和语法突出显示,使其更易于阅读。更好的是,只需单击查看源代码中的缩小文件链接(或直接...导航到它的任何方式)即可到达那里,无需复制/粘贴步骤。
I use Chrome for daily development now...if you're in the same boat, the PrettyPrint extension is excellent for this.
You get indentation and syntax highlighting to make it much easier to read. Even better, just clicking the minified file link from view-source (or going directly...any way you navigate to it works) gets you there, no copy/paste steps involved.
闭包编译器将为 JS 做这件事。将“优化”设置为“仅空白”并选中“漂亮打印”框。对于CSS,Firebug(没有其他附加组件)的CSS选项卡似乎工作得相当好,尽管保存了美化的通过复制和粘贴来编写代码有点困难,但也是可能的(您必须使用键盘,然后在文本编辑器中重新缩进复制的行)。
Closure Compiler will do it for JS. Set "Optimization" to "Whitespace only" and check the "Pretty print" box. For CSS, the CSS tab of Firebug (with no other add-ons) seems to work reasonably well, although saving the beautified code by copy-and-pasting is slightly difficult but possible (you have to use the keyboard, and then re-indent the copied lines in a text editor).
尽管对于这项任务来说可能有点大材小用,但许多 IDE 可以重新格式化缩小的 JavaScript。例如 IntelliJ IDEA 您可以在其中使用菜单元素Code ->;重新格式化代码... IntelliJ 的免费版本就足够了。我想 Jetbrains 用于 HTML/JavaScript 开发的更简单的 IDE,Webstorm 也可以做到这一点,以及其他 IDE,例如 Eclipse 和 NetBeans
Altough maybe overkill for this task, many IDEs can reformat minified JavaScript. E.g. IntelliJ IDEA where you can use the menu element Code -> Reformat Code... The free version of IntelliJ will suffice. I guess Jetbrains simpler IDE for HTML/JavaScript development, Webstorm, can do this as well, as well as other IDEs like Eclipse and NetBeans
如果您使用带有 Firebug 的 Firefox,您可以安装 Yslow:它有一些很好的工具,例如“All JS Beautified”和“All CSS Beautified”。你一定会喜欢的 =)
If you use Firefox with Firebug you may install Yslow: it has some good tools like "All JS Beautified" and "All CSS Beautified". You will like it =)
请参阅我们的ECMAScript 的 SD 格式化程序。
See our SD Formatter for ECMAScript.