bootstrap.css 和 bootstrap-combined.min.css 有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25180360/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 02:27:36  来源:igfitidea点击:

What is the difference between bootstrap.css and bootstrap-combined.min.css?

csstwitter-bootstrap-2

提问by vipin

I am using bootstrap.css and I found that there is another css file named bootstrap-combined.min.css, is there any difference in style? Is there any need to include both css files? Which one is more preferable?

我正在使用 bootstrap.css ,发现还有一个名为bootstrap-combined.min.css 的css文件,样式上有什么区别吗?是否需要同时包含这两个 css 文件?哪个更可取?

回答by joshhunt

The file bootstrap-combined.min.cssis for Bootstrap v2, it is the combined css file of bootstrap.css (the main css file) and bootstrap-responsive.css (the responsive Bootstrap styles). It's exactly the same as using those two files separately but it just saves you an extra request.

文件bootstrap-combined.min.css适用于 Bootstrap v2,它是 bootstrap.css(主 css 文件)和 bootstrap-responsive.css(响应式 Bootstrap 样式)的组合 css 文件。这与单独使用这两个文件完全相同,但它只是为您节省了一个额外的请求。

The "min" part of the filename just means that it has been minified, which is to say that it has had all the unnecessary white-space/comments/etc removed.

文件名的“min”部分仅表示它已被缩小,也就是说它已删除了所有不必要的空格/注释/等。

Conclusion

结论

bootstrap.min.css = compressed version of bootstrap.css
bootstrap-combined.min.css = bootstrap.min.css + bootstrap-responsive.min.css

bootstrap.min.css = bootstrap.css
bootstrap-combined.min.css = bootstrap.min.css + bootstrap-responsive.min.css 的压缩版本

回答by Naing Lin Aung

Basically min is minified version, which is intend for production. In normal version you can see through codes and edit (In some cases, necessary though). Sizes are remarkable reduced in minified version and relieve bandwidth, time and memory.

基本上 min 是缩小版本,用于生产。在普通版本中,您可以查看代码并进行编辑(但在某些情况下,这是必要的)。尺寸在缩小版本中显着减少,并减轻了带宽、时间和内存。

回答by Matthias R.

from the comments: afaik in general the min.js versions of .js files dont have any comment-sections or unneccessary blank-spaces to reduce the file size - at the end of the day, as you already said, there's no difference in functionality. in case of bootrap: you dont have to include both of them (as shown here).

来自评论:afaik 一般而言,.js 文件的 min.js 版本没有任何注释部分或不必要的空格来减小文件大小 - 在一天结束时,正如您已经说过的,功能上没有区别. 在bootrap的情况:你没有包括他们的(如图所示这里)。

回答by Niels Keurentjes

The combinedindicates a collection of bootstrap components merged into one file. The minindicates a minified file, meaning:

combined指示引导组件的集合,合并成一个文件。该min指示缩小的文件,意思是:

Minification (also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code without changing its functionality. These unnecessary characters usually include white space characters, new line characters, comments, and sometimes block delimiters, which are used to add readability to the code but are not required for it to execute.

缩小(也称为最小化或最小化),在计算机编程语言,尤其是 JavaScript 中,是从源代码中删除所有不必要的字符而不改变其功能的过程。这些不必要的字符通常包括空格字符、换行符、注释,有时还包括块分隔符,它们用于增加代码的可读性,但不是执行所必需的。

The minified combined version is most preferable for production deployment, as it minimizes the number of requests and bandwidth used, thus improving page load speed. During development you mayfind a use for non-minified non-combined files for debugging purposes, but that's unlikely. In general, the combined-min version is just fine.

缩小的组合版本最适合生产部署,因为它最大限度地减少了使用的请求数量和带宽,从而提高了页面加载速度。在开发过程中,您可能会发现将非缩小非组合文件用于调试目的,但这不太可能。一般来说,组合最小版本就好了。