drupal - 如何在我的 sass 文件中插入图片?
问题描述
我试图插入我的图片,但我不能:(对不起,但我总是遇到同样的问题:我的 TWIG 代码:
<div class="col-6">
<div class="phone">
</div>
和我的 SASS 代码:
.phone {
background: url('phone.png') no-repeat;
background-size: contain; /*This scales the image accoding to the div*/
background-position: center; /*positions the image in the center*/
width: auto;
height: 50px;
}
我的文件也总是一样的:
- 主菜单
- 电话.png
- 菜单.scss
我总是404错误...
解决方案
中定义的路径url()
需要相对于您的编译.css
文件而不是.scss
文件。
推荐阅读
- python - 传递节点列表时,draw_networkx() 是否计算整个图形的布局?
- python - 为什么我在这段代码中得到一个 `AttributeError`: “'float' object has no attribute 'lower'”?
- python - 将 dict 值设置为自身会创建无限副本
- python - 从“.txt”文件中计算最常用的短语
- python - 如何启动这个 python 图像过滤器?
- c++ - 从不同线程调用函数是阻塞的?
- websocket - Websocket 帧大小规范
- sql - 错误报告 - SQL 错误:ORA-00933:SQL 命令未正确结束
- spring-boot - spring-cloud-starter-contract-verifier 如何将静态方法导入同一项目中的 groovy DSL 合同文件?
- azure - 使用 KeyVault 部署 Azure AD 应用程序、Azure 函数,从 Dev 到 QA 再到 Prod