【问题标题】:chrome app, css inside iframechrome 应用程序,iframe 内的 css
【发布时间】:2016-02-09 18:09:40
【问题描述】:

我有一个 chrome 应用,里面有 iframe

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet" />


<title>Title</title>
</head>
<body >
  <div class="container-fluid">
      <iframe id="iframe" src="home.html" frameborder="0" height="150%" style="width: 100%;"></iframe>
  </div>
</div>
</body>
</html>

web 正在加载,但是当从 chrome 应用程序中的索引调用时,bootstrap-theme.css 没有加载

我也尝试过添加 type="text/css" ,但都没有。

【问题讨论】:

    标签: css google-chrome-app


    【解决方案1】:

    &lt;link rel="stylesheet" type="text/css" href="/css/bootstrap-theme.css"&gt;

    这对你有用吗?

    【讨论】:

      【解决方案2】:

      解决方案:

      正如@SaucedApples 所说,但没有点。

      <link href="/css/bootstrap-theme.css" rel="stylesheet"   />
      

      【讨论】:

        【解决方案3】:

        我认为您应该允许将这些文件附加到 manifest.json 中,如下所示:

        "content_scripts": [
            {
              "matches": ["http://test-website.com/*"], 
              "js": ["js/content-script.js"],
              "css" : ["yourcss.css"]
            }
        ],
        

        【讨论】:

        • 这是一个应用程序,而不是扩展程序
        猜你喜欢
        • 1970-01-01
        • 2011-05-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-07-15
        • 1970-01-01
        • 2013-04-24
        • 2013-01-15
        相关资源
        最近更新 更多