HTML 在线最小化器/压缩器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1654832/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML online minimizer/compressor?
提问by Ted
Does anyone know of a good online generator to take the source code of an HTML page and compress/minimize the entire page.
有谁知道一个好的在线生成器来获取 HTML 页面的源代码并压缩/最小化整个页面。
Meaning, compress/minimize all embedded CSS, JavaScript and obviously the HTML of that web page while also removing unneeded HTML/CSS/JavaScript comments, spaces, tabs, etc?
意思是,压缩/最小化所有嵌入的 CSS、JavaScript 和显然该网页的 HTML,同时还删除不需要的 HTML/CSS/JavaScript 注释、空格、制表符等?
回答by Mathias Bynens
Juriy Zaytsev wrote an HTML minifier in JavaScript, which you can use online on this page: http://kangax.github.com/html-minifier/
Juriy Zaytsev 用 JavaScript 编写了一个 HTML minifier,您可以在此页面上在线使用:http: //kangax.github.com/html-minifier/
As the warning says, it's still an early alpha, so there might be bugs. Use with caution!
正如警告所说,它仍然是一个早期的 alpha,所以可能存在错误。谨慎使用!
回答by BillW
http://prettydiff.com/- This is written in JavaScript so you can use it instantly in your browser.
http://prettydiff.com/- 这是用 JavaScript 编写的,因此您可以立即在浏览器中使用它。
回答by Tamas
There's an online compressor that does minimize all embedded CSS and JavaScript blocks and also the HTML. It produces a single line output code which renders as the original and respects the document structure.
有一个在线压缩器可以最小化所有嵌入的 CSS 和 JavaScript 块以及 HTML。它生成一行输出代码,呈现为原始代码并尊重文档结构。
It uses Yahoo YUI Compressor and Google Closure compiler for JavaScript.
它使用 Yahoo YUI Compressor 和用于 JavaScript 的 Google Closure 编译器。
Check it here: HTMLcompressor.com
在这里查看:HTMLcompressor.com
回答by Zubarik
This is the best minifier I found till date.
这是迄今为止我发现的最好的压缩器。
Check it here: Html, Javascript as well as CSS minifier
回答by Basic Bridge
I came across a script that will minify your HTML, Inline CSS, Inline Javascript On The Fly.
我遇到了一个脚本,可以即时缩小您的 HTML、内联 CSS、内联 Javascript。
Check here Dynamic Website Compressor
在这里查看动态网站压缩器
回答by Andrey Taritsyn
I recommend you to try WebMarkupMin Online.
我建议您尝试WebMarkupMin Online。
回答by Prakash
These are the perfect minifiers:
这些是完美的缩小器:
For Javascript http://javascript-minifier.com/
对于 Javascript http://javascript-minifier.com/
For CSS http://cssminifier.com/
对于 CSS http://cssminifier.com/
For PNG http://pngcrush.com/
对于 PNG http://pngcrush.com/
For JPEG http://jpgoptimiser.com/
对于 JPEG http://jpgoptimiser.com/
回答by devguest
I use HTML JavaScript CSS Minifierfor minify the entire HTML code (including CSS and Javascript).
我使用HTML JavaScript CSS Minifier来缩小整个 HTML 代码(包括 CSS 和 Javascript)。
You can also encrypt the Javascript parts on Javascript minifier encryptorto make it less readable but it increase the size of your file.
您还可以在Javascript minifier encryptor 上加密Javascript 部分,以降低其可读性,但会增加文件的大小。
回答by bartosz.r
A duplicate of https://stackoverflow.com/questions/728260/html-minification?
https://stackoverflow.com/questions/728260/html-minification的副本?
And if you do not really need an ON-Line tool, then PageSpeed plugin for Firefox and the Yahho compressor are both really good minifiers. Also the PageSpeed tool can give you hints what to change, and which change will give the biggest change in speed/size.
如果您真的不需要在线工具,那么用于 Firefox 的 PageSpeed 插件和 Yahho 压缩器都是非常好的缩小器。此外,PageSpeed 工具可以给您提示要更改的内容,以及哪些更改将导致速度/大小的最大变化。