简体   繁体   English

移动应用的背景图片

[英]Background images for mobile apps

I use Ionic for making a hybrid application. 我使用Ionic制作混合应用程序。 I have read the documentation regarding setting background images for different devices, but I was wondering if it is better to use device resolution or pixel density values for setting background images? 我已经阅读了有关为不同设备设置背景图像的文档,但是我想知道使用设备分辨率或像素密度值设置背景图像是否更好?

If we want a background img we put it inside a or a for example, and put the following styles in css: 如果我们想要背景img,则将其放在a或a之内,然后将以下样式放在css中:

.img-class-name{
      background: url("../img/path/to/your.jpg") center;
      background-size: cover;
}

our images are in the default folder: 我们的图像位于默认文件夹中:

在此处输入图片说明

This has worked fine for all our needs. 可以很好地满足我们的所有需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM