2016-09-02 27 views
1

我有一個問題,我想昨天,他們解決了我的問題,但現在我有一個新問題:/問題是,我需要定位的CSS加載器下去,因爲當我添加它就像在正文下我上面有它的例如像這樣的代碼:我該如何讓這個css loader的位置下降?

<!-- Only An Example Not My Full Code --> 
<center><h1>Example</h1></center> 
<div id="squaresWaveG"> 
<div id="squaresWaveG_1" class="squaresWaveG"> 
</div> 
<div id="squaresWaveG_2" class="squaresWaveG"> 
</div> 
<div id="squaresWaveG_3" class="squaresWaveG"> 
</div> 
<div id="squaresWaveG_4" class="squaresWaveG"> 
</div> 
<div id="squaresWaveG_5" class="squaresWaveG"> 
</div> 
<div id="squaresWaveG_6" class="squaresWaveG"> 
</div> 
<div id="squaresWaveG_7" class="squaresWaveG"> 
</div> 
<div id="squaresWaveG_8" class="squaresWaveG"> 
</div> 
</div> 

所以當我這樣做,然後代碼的CSS加載器右側的文本下,我不希望出現這種情況,我希望它像接近在頁面的底部,但我不知道如何使它往下走,這是我的全碼:

https://jsfiddle.net/4Ljayw2f/1/

#squaresWaveG{ 
 
position:relative; 
 
width:240px; 
 
height:29px; 
 
margin:0 auto; 
 
} 
 

 
.squaresWaveG{ 
 
position:absolute; 
 
top:0; 
 
background-color:#000000; 
 
width:29px; 
 
height:29px; 
 
-moz-animation-name:bounce_squaresWaveG; 
 
-moz-animation-duration:3.3s; 
 
-moz-animation-iteration-count:infinite; 
 
-moz-animation-direction:linear; 
 
-webkit-animation-name:bounce_squaresWaveG; 
 
-webkit-animation-duration:3.3s; 
 
-webkit-animation-iteration-count:infinite; 
 
-webkit-animation-direction:linear; 
 
-ms-animation-name:bounce_squaresWaveG; 
 
-ms-animation-duration:3.3s; 
 
-ms-animation-iteration-count:infinite; 
 
-ms-animation-direction:linear; 
 
-o-animation-name:bounce_squaresWaveG; 
 
-o-animation-duration:3.3s; 
 
-o-animation-iteration-count:infinite; 
 
-o-animation-direction:linear; 
 
animation-name:bounce_squaresWaveG; 
 
animation-duration:3.3s; 
 
animation-iteration-count:infinite; 
 
animation-direction:linear; 
 
} 
 

 
#squaresWaveG_1{ 
 
left:0; 
 
-moz-animation-delay:1.32s; 
 
-webkit-animation-delay:1.32s; 
 
-ms-animation-delay:1.32s; 
 
-o-animation-delay:1.32s; 
 
animation-delay:1.32s; 
 
} 
 

 
#squaresWaveG_2{ 
 
left:30px; 
 
-moz-animation-delay:1.65s; 
 
-webkit-animation-delay:1.65s; 
 
-ms-animation-delay:1.65s; 
 
-o-animation-delay:1.65s; 
 
animation-delay:1.65s; 
 
} 
 

 
#squaresWaveG_3{ 
 
left:60px; 
 
-moz-animation-delay:1.98s; 
 
-webkit-animation-delay:1.98s; 
 
-ms-animation-delay:1.98s; 
 
-o-animation-delay:1.98s; 
 
animation-delay:1.98s; 
 
} 
 

 
#squaresWaveG_4{ 
 
left:90px; 
 
-moz-animation-delay:2.31s; 
 
-webkit-animation-delay:2.31s; 
 
-ms-animation-delay:2.31s; 
 
-o-animation-delay:2.31s; 
 
animation-delay:2.31s; 
 
} 
 

 
#squaresWaveG_5{ 
 
left:120px; 
 
-moz-animation-delay:2.64s; 
 
-webkit-animation-delay:2.64s; 
 
-ms-animation-delay:2.64s; 
 
-o-animation-delay:2.64s; 
 
animation-delay:2.64s; 
 
} 
 

 
#squaresWaveG_6{ 
 
left:150px; 
 
-moz-animation-delay:2.97s; 
 
-webkit-animation-delay:2.97s; 
 
-ms-animation-delay:2.97s; 
 
-o-animation-delay:2.97s; 
 
animation-delay:2.97s; 
 
} 
 

 
#squaresWaveG_7{ 
 
left:180px; 
 
-moz-animation-delay:3.3s; 
 
-webkit-animation-delay:3.3s; 
 
-ms-animation-delay:3.3s; 
 
-o-animation-delay:3.3s; 
 
animation-delay:3.3s; 
 
} 
 

 
#squaresWaveG_8{ 
 
left:210px; 
 
-moz-animation-delay:3.63s; 
 
-webkit-animation-delay:3.63s; 
 
-ms-animation-delay:3.63s; 
 
-o-animation-delay:3.63s; 
 
animation-delay:3.63s; 
 
} 
 

 
@-moz-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@-webkit-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@-ms-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@-o-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
}
<div id="squaresWaveG"> 
 
<div id="squaresWaveG_1" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_2" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_3" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_4" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_5" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_6" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_7" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_8" class="squaresWaveG"> 
 
</div> 
 
</div>

回答

0

確定多遠下跌的一頁你想要的圖像,並添加

頂:300像素;

到您的CSS。

#squaresWaveG{ 
position:relative; 
top: 200px; 
width:240px; 
height:29px; 
margin:0 auto; 
} 
0

只需將您的位置更改爲absolute並居中。

#squaresWaveG{ 
position:absolute; 
width:240px; 
height:29px; 
margin:0 auto; 
bottom: 3em; 
left: 50%; 
margin-left: -120px; 
} 

JSFiddle

哦,PS,有什麼不同的ID和Class的意義呢?乍看之下不確定原因,但聰明。 :)

+0

小提琴,我會嘗試這個太,THX –

0

.test-div{ 
 
    position: fixed; 
 
    width: 100%; 
 
    height:100%; 
 

 
} 
 
#squaresWaveG{ 
 
position:absolute; 
 
bottom: 10px; 
 
left: 50%; 
 
margin-left: -120px; 
 
width:240px; 
 
height:29px; 
 

 
} 
 

 
.squaresWaveG{ 
 
position:absolute; 
 
top:0; 
 
background-color:#000000; 
 
width:29px; 
 
height:29px; 
 
-moz-animation-name:bounce_squaresWaveG; 
 
-moz-animation-duration:3.3s; 
 
-moz-animation-iteration-count:infinite; 
 
-moz-animation-direction:linear; 
 
-webkit-animation-name:bounce_squaresWaveG; 
 
-webkit-animation-duration:3.3s; 
 
-webkit-animation-iteration-count:infinite; 
 
-webkit-animation-direction:linear; 
 
-ms-animation-name:bounce_squaresWaveG; 
 
-ms-animation-duration:3.3s; 
 
-ms-animation-iteration-count:infinite; 
 
-ms-animation-direction:linear; 
 
-o-animation-name:bounce_squaresWaveG; 
 
-o-animation-duration:3.3s; 
 
-o-animation-iteration-count:infinite; 
 
-o-animation-direction:linear; 
 
animation-name:bounce_squaresWaveG; 
 
animation-duration:3.3s; 
 
animation-iteration-count:infinite; 
 
animation-direction:linear; 
 
} 
 

 
#squaresWaveG_1{ 
 
left:0; 
 
-moz-animation-delay:1.32s; 
 
-webkit-animation-delay:1.32s; 
 
-ms-animation-delay:1.32s; 
 
-o-animation-delay:1.32s; 
 
animation-delay:1.32s; 
 
} 
 

 
#squaresWaveG_2{ 
 
left:30px; 
 
-moz-animation-delay:1.65s; 
 
-webkit-animation-delay:1.65s; 
 
-ms-animation-delay:1.65s; 
 
-o-animation-delay:1.65s; 
 
animation-delay:1.65s; 
 
} 
 

 
#squaresWaveG_3{ 
 
left:60px; 
 
-moz-animation-delay:1.98s; 
 
-webkit-animation-delay:1.98s; 
 
-ms-animation-delay:1.98s; 
 
-o-animation-delay:1.98s; 
 
animation-delay:1.98s; 
 
} 
 

 
#squaresWaveG_4{ 
 
left:90px; 
 
-moz-animation-delay:2.31s; 
 
-webkit-animation-delay:2.31s; 
 
-ms-animation-delay:2.31s; 
 
-o-animation-delay:2.31s; 
 
animation-delay:2.31s; 
 
} 
 

 
#squaresWaveG_5{ 
 
left:120px; 
 
-moz-animation-delay:2.64s; 
 
-webkit-animation-delay:2.64s; 
 
-ms-animation-delay:2.64s; 
 
-o-animation-delay:2.64s; 
 
animation-delay:2.64s; 
 
} 
 

 
#squaresWaveG_6{ 
 
left:150px; 
 
-moz-animation-delay:2.97s; 
 
-webkit-animation-delay:2.97s; 
 
-ms-animation-delay:2.97s; 
 
-o-animation-delay:2.97s; 
 
animation-delay:2.97s; 
 
} 
 

 
#squaresWaveG_7{ 
 
left:180px; 
 
-moz-animation-delay:3.3s; 
 
-webkit-animation-delay:3.3s; 
 
-ms-animation-delay:3.3s; 
 
-o-animation-delay:3.3s; 
 
animation-delay:3.3s; 
 
} 
 

 
#squaresWaveG_8{ 
 
left:210px; 
 
-moz-animation-delay:3.63s; 
 
-webkit-animation-delay:3.63s; 
 
-ms-animation-delay:3.63s; 
 
-o-animation-delay:3.63s; 
 
animation-delay:3.63s; 
 
} 
 

 
@-moz-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@-webkit-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@-ms-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@-o-keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
} 
 

 
@keyframes bounce_squaresWaveG{ 
 
0%{ 
 
background-color:#000000; 
 
} 
 

 
100%{ 
 
background-color:#FFFFFF; 
 
} 
 

 
}
<div class="test-div"> 
 
<div id="squaresWaveG"> 
 
<div id="squaresWaveG_1" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_2" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_3" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_4" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_5" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_6" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_7" class="squaresWaveG"> 
 
</div> 
 
<div id="squaresWaveG_8" class="squaresWaveG"> 
 
</div> 
 
</div> 
 
</div> //test dive ends

檢查我已經更新https://jsfiddle.net/4Ljayw2f/2/

相關問題