[英]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.