在我的AngularJS网站被完全引导之前,我想显示一个全屏图像。
一种方法是使用ng-cloak。
这是一个例子,用来显示一行单词。
我试着用全屏图像代替。
[ng-cloak].splash {
/* The image used */
background-image: url("https://media.thetab.com/blogs.dir/13/files/2017/02/nice-guy-2.jpg");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}http://plnkr.co/edit/OTYwqGehVAsw5R8V?preview
但这不起作用。有人知道为什么吗?
发布于 2018-04-26 04:23:20
你错过了display: block !important;在[ng-cloak].splash
[ng-cloak].splash {
/* The image used */
background-image: url("https://media.thetab.com/blogs.dir/13/files/2017/02/nice-guy-2.jpg");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
display: block !important;
}http://plnkr.co/edit/oiGcMrO18nMt8KmM1d6X?preview&p=preview
https://stackoverflow.com/questions/50034707
复制相似问题