我是Ionic框架的新手,我正在尝试使用如下的全屏背景图像来启动应用程序:
我确实设法删除了本教程中显示的状态栏。但是我如何添加一个全屏图像呢?当我将这段代码添加到style.css中时,它没有反应:
html, body{
background-image: black;
}
发布于 2014-06-01 20:20:03
在你的css中,尝试:
.scroll-content {
background: url(image) [add image position info here];
[add any more properties here]
}
这将设置完整内容区域的背景。
发布于 2015-05-07 18:24:54
确保图像路径的开头有"../“,这将在为设备构建应用程序后将其指向资源文件夹中的正确图像路径。使用窗格方法似乎只会带来问题,这对我来说是最好的解决方案,当图像在提供服务时出现,而不是在我的android设备上。
.scroll-content{
background: url("../media/images/background.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
发布于 2014-12-03 08:09:48
非常类似于Helmut的回答,它使用‘in’工作,但当我推送到Android (我的例子是Nexus7的4.2.2)时,它给了我一个白色的背景。
如果你想让背景全屏,窗格类选择器是正确的,但是如果我设置了" background“值,android似乎只会把背景变成白色。使用"background-image“可以把事情做好。
我发现下面的代码在Android和Chrome上都能用(在网络测试时)。
.pane {
background-image: url(image);
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
https://stackoverflow.com/questions/23906945
复制相似问题