📄 31.html
字号:
<html>
<head>
<title>文字颜色渐变</title>
</head>
<body bgcolor="lightyellow" onload="TimerID2=setTimeout('fLi2()',500)" onunload="clearTimeout(TimerID2)">
<script language="JAVASCRIPT">
colors2 = new Array(6); //设置渐变颜色数组
colors2[0]="#000000";
colors2[1]="#333300";
colors2[2]="#665500";
colors2[3]="#997700";
colors2[4]="#CC9900";
colors2[5]="#FFCC00";
var i=0;
function fLi2() {
line2.style.visibility = "visible";
if (i<6) {
line2.style.color = colors2[i];
i++;
timerID2 = setTimeout( "fLi2()", 200); //设置渐变时间
}
else {
i=0;
line2.style.visibility="hidden";
TimerID2=setTimeout("fLi2()",1000); //设置隐藏到显示的间隔时间
}}
</script>
<div id=line2 style="container:positioned; position=relative; width=50%; height=10%; left=10%;
font-family=隶书; font-size=35px; line-height=28px; color=black; visibility=hidden;">
欢迎光临!
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -