[英]Ionic Background image : center not working on Android
我正在升級我的Ionic App版本:
ionic: ionic-bower#1.2.4
ionic-platform-web-client": ^0.7.1
cordova: 6.1.1
升級后,背景圖片未居中,我的CSS代碼為:
body {
background:url('../img/splash.png') rgb(227,227,213) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
而我的身體html僅是:
</head>
<body ng-app="starter">
<ion-spinner></ion-spinner>
</body>`
是離子的可能錯誤? 我究竟做錯了什么?
我也有問題,找到了此鏈接
因此,這是如何在混合應用程序中為所有大小的設備添加背景的解決方案。因此,您必須將以下CSS添加到style.css中。 您必須為滾動內容添加相同的CSS,因為上述CSS僅適用於屏幕,而不適用於可滾動屏幕。
.BackgroundImage{ background: url(image.jpg) no-repeat center center fixed; -webkit-background-size: contain; -moz-background-size: contain; -o-background-size: contain; background-size:contain; } .scroll-content{ background: url(image.jpg) no-repeat center center fixed; -webkit-background-size: contain; -moz-background-size: contain; -o-background-size: contain; background-size:contain; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.