【问题标题】:How to convert css background url to embeded html url?如何将css背景url转换为嵌入html url?
【发布时间】:2018-07-05 10:54:04
【问题描述】:

例如,a.html

<link rel="stylesheet" href="a.css">

a.css

.bg {
    width: 100%;
    background: url(/a.gif) bottom repeat-x;
}

浏览器将首先获得a.html,然后是a.css,然后是a.gif

有没有办法把a.gif放在html中,这样浏览器就可以同时请求a.cssa.gif

【问题讨论】:

    标签: html css linux http web


    【解决方案1】:

    是的,您可以使用预取标记,就像在您的&lt;head&gt; 中一样:

    <link rel="prefetch" href="/a.gif">
    

    【讨论】:

      猜你喜欢
      • 2018-08-13
      • 2012-08-03
      • 1970-01-01
      • 2015-04-11
      • 2015-03-02
      • 1970-01-01
      • 1970-01-01
      • 2020-10-01
      • 1970-01-01
      相关资源
      最近更新 更多