【问题标题】:not linked to bootstrap.css.map but shows in console未链接到 bootstrap.css.map 但显示在控制台中
【发布时间】:2015-06-30 08:59:57
【问题描述】:

以下是我使用的代码,这是来自模板,当我运行此文件时,我看到错误

bootstrap.css.map:1 GET http://localhost:8000/css/bootstrap.css.map 404 (Not Found)

但是我没有创建链接,并且错误显示链接在第一行,有人可以帮助我链接在哪里

如何删除该链接,有人可以帮我解决这个问题

<!DOCTYPE HTML>
<html lang="en">
    <head>
        <title>Animus A Blogging Category Flat Bootstarp Resposive Website Template | Home :: w3layouts</title>
        <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all">
        <link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="keywords" content="Graphic Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
              Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
    </head>
    <body>
        <div class="contact-top">
            <div class="container">
                <h2>Log in</h2>     
                <div class="contact">
                    <p></p>
                    <div class="contact-down">
                        <div class="contact-right">
                            <div class="col-md-6 contact-info">
                                <form>
                                    <input type="text" name="your name" placeholder="USER NAME" class="input">              
                                    <input type="password" name="your email" placeholder="PASSWORD" class="input">
                                    <div class="clearfix"> </div>
                                    <input type="submit"value="SEND" />
                                </form>                 
                            </div>
                            <div class="clearfix"> </div>
                        </div>
                    </div>
                </div>  
            </div>
        </div>
    </body>
</html>

【问题讨论】:

标签: css twitter-bootstrap


【解决方案1】:

它来自您的 bootstrap.css 文件。您可以通过编辑该文件并从代码中删除以下行来删除引用:

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

【讨论】:

  • 感谢它的工作,但我认为它只是一些 txt,它不会链接文件
  • 从技术上讲,它实际上并没有链接,也没有加载到您的网站上。它正在加载到 Chrome DevTools 中。您可以在此处阅读有关什么以及如何使用 Source Maps 的更多信息:html5rocks.com/en/tutorials/developertools/sourcemaps 这是一种非常强大且方便的方式来处理经过预处理、缩小、丑化等的代码。
  • 去掉sourceMappingURL=bootstrap.css.map有什么危害吗?
【解决方案2】:

源映射文件只能由开发人员工具使用。 使用 Bootstrap,您可以根据需要禁用源映射,或者在使用开发工具时忽略任何 .css.map 的 404。

如果您想使用开发工具进行调试或希望代码更“完整”,请将 Bootstrap 提供的 .css.map 文件与 .css 文件一起添加。

参考:https://developer.chrome.com/devtools/docs/css-preprocessors

其他类似问题:what are the .map files used for in Bootstrap 3.1?

【讨论】:

    【解决方案3】:

    你可以删除

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

    如@xengravity 所述,或者您可以下载引导版本的 bootstrap.css.map 文件并将其添加到您的目录中。

    【讨论】:

      猜你喜欢
      • 2020-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多