CSS Filter 代替 图片 实现 渐变背景效果。

本文介绍了一种使用CSS滤镜实现网页渐变背景的方法,这种方法相较于传统的图片背景能够减少页面加载时间,提高用户体验。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以前欲做一个渐变的背景,一般都是用图片。
一次偶然发现用CSS Filter 可以实现相同的效果,而最重要的好处是它可以省去你去下载图片所使用时间。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>Untitled Document</title>
<style type="text/css">
<!--
body 
{
    margin-left
: 0px;
    margin-top
: 0px;
    margin-right
: 0px;
    margin-bottom
: 0px;
}
-->
</style></head>

<body>
<table width="100%" height="133"  border="0" cellspacing="0">
  
<tr>
    
<td>&nbsp;</td>
    
<td style="FILTER: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FFFFFF', endColorStr='#ADADAD', gradientType='1')" width="48%">&nbsp;</td>
  
</tr>
  
<tr>
    
<td>&nbsp;</td>
    
<td>&nbsp;</td>
  
</tr>
</table>
</body>
</html>

转载于:https://www.cnblogs.com/publicbill/archive/2006/06/01/414690.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值