css - Ionic 3:图像文件未加载到设备中
问题描述
我不知道出了什么问题。当我尝试ionic serve
一切正常加载。但是,当我尝试在 android 设备上运行它时,没有任何图像加载,而是显示错误Failed to load resource: net::ERR_FILE_NOT_FOUND
没有正确加载图像。
我的 scss 文件
.bg-image{
background-image: url('../../assets/imgs/bgimage.png');
background-repeat: no-repeat;
background-size: 200%;
background-attachment: fixed;
position: absolute;
我的 html 文件
<div class="bg-image">
.
.
</div>
无法弄清楚请帮忙。
解决方案
Try changing the path keep images in main www/assets/img folder and then set
background-image: url('assets/img/bgimage.png');
推荐阅读
- blazor - Blazor:无法从继承的基类访问组件中的对象
- artifactory - org.artifactory.storage.StorageException:无法更新唯一索引表
- c++ - 如何方便地初始化一个类的静态成员?
- reactjs - How to run Next Js application build (out) directory?
- azure-devops-rest-api - Azure DevOps Server 按文件夹名称获取分支
- python-3.x - 错误:字符串索引必须是整数,同时从 API 网关请求解包 request.body 对象以获取 lambda 函数
- r - 获取其他向量的因子水平(和不存在的集合)
- python - 在 x 次请求后限制用户对服务的访问
- server - Livecode - 使客户端在丢失连接时自动重新连接
- java - Consul Health 指示器未显示在 SpringBoot 的执行器健康端点中