html - CSS背景图像不会被加载并且代码不会被更新
问题描述
在我的 CSS 文件中,我编写了代码
/*The code I write*/
.wrapper::before {
content: "";
position: absolute;
bottom: -30%;
left: 0;
height: 100%;
width: 100%;
background: url(../img/homeTrans2.svg) no-repeat top right/ cover;
}
注意:我确保保存我的工作
但是当我尝试加载它时,我的计算机将代码读取为
/*The code when the computer reads it*/
.wrapper::before {
content: "";
position: absolute;
bottom: -30%;
left: 0;
height: 100%;
width: 100%;
background: url(./img/homeTrans2.svg) no-repeat top right/ cover;
}
注意:注意后台 URL 中的点数
为什么我无法访问我的文件?
注意:我知道我可以重新组织我的文件以使其正常工作,但我希望我的文件夹更有条理
解决方案
尝试将图像保存在项目的同一目录中,然后更改路径。
推荐阅读
- javascript - 使用 jQueryMobile CSS 的网页分割问题
- elasticsearch - logstash remove_field 无法将 csv 上传到 elasticsearch
- google-apps-script - 从属下拉列表
- typescript - 如果对象被破坏,打字稿类型会失败
- python-3.x - python:从字典创建numpy数组,其中键是坐标
- c# - 在 MassTransit 6.0 中使用 Autofac 的 NLog?
- selenium - Selenium 隐式/显式等待不起作用
- git - 当使用 git log --graph 我的提交在不同的分支上丢失
- javascript - 如何从nodejs中Jimp库中的结果对象发送请求
- linux - GCP 持久卷上的非 ASCII 文件名无法正确显示