在thymelaf中通过css设置背景图像不起作用



我使用以下css格式来显示表单提交时的加载面板,我已经将gif图像存储在\src\main\resources\static中,但htmldiv没有拾取图像,它采用了除图像之外的所有其他css格式。我提到了以下SOF链接,但上述解决方案不起作用。有人遇到过类似的问题吗?

如何在thymelaf中设置css文件的背景url?


<style >
#loader {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;

background: rgba(0,0,0,0.75) url([[@{/loading2.gif}]]) no-repeat center center;

z-index: 10000;
}
</style>

您已经设置了display: none;,因此包括背景图像在内的元素是不可见的。除掉这处房产。

除此之外,它看起来还不错。

最新更新