html - 背景图片 url() 不使用 sass 编译
问题描述
我在 VS 代码中使用 Live Sass 编译器。早些时候,我使用 Node JS 将 sass 转换为 css。代码工作正常,但我在 css 中看不到任何背景图像 url()。它也不会在输出中显示背景。scss 文件中的图像路径正确。我为此使用变量。
$show-home-image: true;
$home-image: url(../img/background.jpg);
$background-opacity: 0.9;
@mixin background {
@if $show-home-image {
&#bg-img {
background: $home-image;
background-attachment: fixed;
background-size: cover;
解决方案
推荐阅读
- excel - 如何使用 WinHTTPRequest 在 Excel 中使用 VBA 发送表单数据 POST 请求
- node.js - 通过对唯一的 id 进行分组来计算 5 星评分的平均值
- vim - 删除以前的所有单词
- powershell - 如何使用powershell在excel中获取唯一值
- javascript - 如何在 React 中禁用 iframe console.log
- java - 排序列表仅比较初始列表内对象列表中的第一个字符串
- javascript - React Hooks:地图函数内的 setState 钩子
- jenkins - 如何使用groovy在jenkins中查找使用特定存储库url的所有作业并禁用它们
- spring-boot - 有没有办法使用 Gradle 和 hatoas 将 Swagger2 添加到 SpringBoot 应用程序中?
- python - 在 pandas 数据框中查找最大值的索引(超过一个)