确定在发布到Web后某些图像无法加载的原因

时间:2018-01-11 03:00:39

标签: html css cpanel

好的,我的网站就像95%那样。而且我完全不知道为什么我看不到它们。

除了在通过我的cPanel发布后不会显示三个图像外,其他所有功能都可以使用。不加载的文件是Layer4.png,Layer3.png,Layer2.png

图像和css url引用之间的所有命名都是正确的。我检查过图像没有损坏或损坏。一切都在正确的目录中。每个层的代码都相同,只有文件名是唯一的。有一些java脚本在每一层之间创建了一个视差,但我认为这并不重要,因为只有三层受到影响但使用相同的代码。

有任何解决方法吗?

.layer-0 {
    top: 40px;
    z-index: 5; 
    background:-webkit-linear-gradient(#f90, #FC0); 
}

.layer-1 {
    top: 100px;
    z-index: 5;
    background-image: url("images/Layer4.png");
    background-position: bottom center fixed;
    background-size:100%;
}

.layer-2 {
    top: 100px;
    z-index: 10;
    background-image: url("images/Layer3.png");
    background-position: bottom center fixed;
    background-size:100%;
}

.layer-3 {
    top: 100px;
    z-index: 15;
    background-image: url("images/Layer2.png");
    background-position: bottom center fixed;
    background-size:100%;
}

.layer-4 {
    top: 90px;
    z-index: 20;
    background-image: url("images/Layer1.png");
    background-position: bottom center fixed;
    background-size:100%;
}

.layer-5 {
    top:105px;
    z-index: 25;
    background-image: url("images/Layer0.png");
    background-position: bottom center fixed;
    background-size:100%;

1 个答案:

答案 0 :(得分:0)

根据您发布的代码,如果您希望它们绝对定位,您缺少元素的相对容器,并且您需要div中的内容或静态地调整它们的大小,请参阅此示例,我使用占位符图像第5层向您展示:



.layer-0 {
top: 40px;
z-index: 5; 
background:-webkit-linear-gradient(#f90, #FC0); }
.layer-1 {
top: 100px;
z-index: 5;
background-image: url("images/Layer4.png");
background-position: bottom center fixed;
background-size:100%;
}
.layer-2 {
top: 100px;
z-index: 10;
background-image: url("images/Layer3.png");
background-position: bottom center fixed;
background-size:100%;
}
.layer-3 {
top: 100px;
z-index: 15;
background-image: url("images/Layer2.png");
background-position: bottom center fixed;
background-size:100%;
}
.layer-4 {
top: 90px;
z-index: 20;
background-image: url("images/Layer1.png");
background-position: bottom center fixed;
background-size:100%;
}
.layer-5 {
position: absolute;
top:105px;
z-index: 25;
background-image: url("http://placehold.it/500x500");
background-position: bottom center fixed;
background-size:100%;
outline: 5px solid orangered;
height: 500px;
width: 100%;
}
.relative {
position: relative;
}

<div class="relative">
<div class="layer-5"></div>
</div>
&#13;
&#13;
&#13;