html - 如何将 css 背景 url 转换为嵌入 html url?

标签 html css linux http web

例如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

最佳答案

是的,您可以使用预取标签,就像在您的 <head> 中这样:

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

关于html - 如何将 css 背景 url 转换为嵌入 html url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48455615/

相关文章:

css - 如何为背景图像添加边距?

javascript - JQuery/Javascript 基于单选框在表格中设置输入框

html - 水平滚动出现在 Bootstrap 上

php - 如何使用单个查询创建多个搜索字段? [PHP/HTML]

jquery - 在 POSTMAN 测试中使用 jquery 解析 HTML 响应正文

CSS div 区域未出现(但在 firebug 中显示?)

html - 如何找出打开了多少层?

linux - 右箭头键有问题

linux - ansible stat 检查上次修改时间

linux - Spring Boot 应用程序作为服务 - 在前台而不是守护进程中运行