制作网页中的渐变背景方法

时间:2008-10-06 10:32:16  来源:第二电脑网上收集  作者:

  第二电脑网导读:,代码如下:<html><body style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#000000)"><center><font size="+3"><strong>网页背景色渐变<br>(从白色到黑色) </strong></font> <br><br></center></body><...
  正文: 方法一:
用图实现
1切一张1*760的渐变背景图
2在dw中添加做背景

方法二:
Css实现,代码如下:
<html>
<body style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#000000)">
<center>
<font size="+3"><strong>网页背景色渐变<br>
(从白色到黑色) </strong></font> <br>
<br>
</center>
</body>
</html>

下面这个是斜角渐变啊
<html>
<body style="FILTER: Alpha( style=1,opacity=25,finishOpacity=100,startX=50,finishX= 100,startY=50,finishY=100); background-color: skyblue">
<h1>背景渐变(左上至右下)</h1>
</body>
</html>
很COOL的哦!

方法三:
JavaScript实现
<SCRIPT LANGUAGE="javascript">

<!-- Hide from old browsers
var Color= new Array(9);
Color[1] = "ff";
Color[2] = "ee";
Color[3] = "dd";
Color[4] = "cc";
Color[5] = "bb";
Color[6] = "aa";
Color[7] = "99";
Color[8] = "88";
Color[9] = "77";
Color[10] = "66";
Color[11] = "55";
Color[12] = "44";
Color[13] = "33";
Color[14] = "22";
Color[15] = "11";
Color[16] = "00";
/* Do not display text on a fading background. Instead, let it
fade in and out once or twice, then load a new page. */
function fadeIn(where) {
if (where >= 1) {
document.bgColor="#" + Color[where] +"0000";
where -= 1;
setTimeout("fadeIn("+where+")", 15);
} else {
setTimeout('fadeOut(1)', 15);
}
}
function fadeOut(where) {
if (where <=16) {
document.bgColor="#" + Color[where] +"0000";
where += 1;
setTimeout("fadeOut("+where+")", 15)
} else {
setTimeout("fadeIn(16)", 15);
// window.location.href="http://www.moontoucher.net";
}
}
// Unhide -->
</SCRIPT>

<body bgcolor="#fef4d9" onLoad="fadeIn(16)">

"制作网页中的渐变背景方法"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Page/HTML/2008-10-06/1751.html


关键字:

关于《制作网页中的渐变背景方法》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td