使用此之後CSS和HTML Code.It可以閃爍,改變顏色自動
<style>
.blink {
animation: blink-animation 1s steps(5, start) infinite;
-webkit-animation: blink-animation 1s steps(5, start) infinite;
}
@keyframes blink-animation {
to {
visibility: hidden;
}
}
@-webkit-keyframes blink-animation {
to {
visibility: hidden;
}
}
p{
-webkit-animation: color-change 1s infinite;
-moz-animation: color-change 1s infinite;
-o-animation: color-change 1s infinite;
-ms-animation: color-change 1s infinite;
animation: color-change 1s infinite;
margin-top:-10px;
}
@-webkit-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-moz-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-ms-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@-o-keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
@keyframes color-change {
0% { color: red; }
50% { color: blue; }
100% { color: red; }
}
</style>
<?php
$i="*";
$row = 4;
for($k = 0; $k <3;$k++){
for($j=1; $j<=$row; $j++){
echo "<center class='blink''><p>$i</p></center>";
$i .="**";
}
$i="*";
$row++;
}
?>
聖誕節一過,爲什麼是現在?你有點晚了;-)順便說一句,你有什麼嘗試嗎? –
*「我被賦予一項任務讓它閃爍。」* - 這是「你的」任務,而不是「我們的」任務。嘗試一下。這個問題太廣泛了。 –
PHP是服務器端,CSS不是非常動態的,所以我沒有預見到這個沒有JavaScript的工作。 – Devon