CSS文件夹中包含两个扩展名为.map的文件。它们是:

bootstrap-theme.css.map
bootstrap.css.map

它们看起来是缩小版的文件,但我不知道它们是干什么用的。


当前回答

什么是CSS映射文件?

它是一个JSON格式的文件,将CSS文件链接到它的源文件,通常是在预处理器中编写的文件(即Less, Sass, Stylus等),这是为了从web浏览器对源文件进行实时调试。

什么是CSS预处理器?例子:Sass, Less, Stylus

它是一个CSS生成器工具,使用编程能力来健壮而快速地生成CSS。

其他回答

在Chrome DevTools中使用CSS预处理器:

Many developers generate CSS style sheets using a CSS preprocessor, such as Sass, Less, or Stylus. Because the CSS files are generated, editing the CSS files directly is not as helpful. For preprocessors that support CSS source maps, DevTools lets you live-edit your preprocessor source files in the Sources panel, and view the results without having to leave DevTools or refresh the page. When you inspect an element whose styles are provided by a generated CSS file, the Elements panel displays a link to the original source file, not the generated .css file.

什么是CSS映射文件?

它是一个JSON格式的文件,将CSS文件链接到它的源文件,通常是在预处理器中编写的文件(即Less, Sass, Stylus等),这是为了从web浏览器对源文件进行实时调试。

什么是CSS预处理器?例子:Sass, Less, Stylus

它是一个CSS生成器工具,使用编程能力来健壮而快速地生成CSS。

如果你只是想摆脱这个错误,你也可以在bootstrap.css中删除这一行:

/*# sourceMappingURL=bootstrap.css.map */

引导css可以由Less生成。map文件的主要目的是用来链接css源代码到chrome开发工具中的less源代码。 如果我们在chrome开发工具中检查元素。你可以看到css的源代码。 但如果包含地图文件在页面与引导css文件。您可以看到应用于想要检查的元素样式的代码更少。

这些是源地图。将这些文件与压缩源文件一起提供;Firefox和Chrome等开发工具将使用它们来进行调试,就像代码没有被压缩一样。