[英]Background image doesn't work on Safari v14 Catalina
我的项目快完成了,但遇到了背景图像在 MacOS Catalina Safari 版本 14 上不起作用的问题。你知道问题出在哪里吗? 先谢谢了,呵呵。 我还应该提到该项目是在 React with TS 上编写的。
.image {
width: calc(100vw - 48rem);
height: 100vh;
background: url('../../public/img/auth-bg.jpg') left center no-repeat;
-o-background-size: cover;
-moz-background-size: cover;
-ms-background-size: cover;
-webkit-background-size: cover;
background-size: cover;
@include mobile() {
width: 0;
}
}
试试这个,公共 URL 是项目中的基础 Url 你可以这样
.image {
width: calc(100vw - 48rem);
height: 100vh;
background: url('/img/auth-bg.jpg') left center no-repeat;
-o-background-size: cover;
-moz-background-size: cover;
-ms-background-size: cover;
-webkit-background-size: cover;
background-size: cover;
@include mobile() {
width: 0;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.