div+css背景渐变色代码示例
(编辑:jimmy 日期: 2025/2/22 浏览:3 次 )
这个示例代码就是上面是红色,下面是黑色,渐变色的。
复制代码代码如下:
<style type="text/css">
#round {
height: 200px;
width:100px;
margin:0px auto;
background-image: -moz-linear-gradient(top, #F00, #000);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #F00), color-stop(1,#000));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#F00', endColorstr='#000', GradientType='0');
}
</style>
<div id="round"></div>
演示效果图

复制代码代码如下:
<style type="text/css">
#round {
height: 200px;
width:100px;
margin:0px auto;
background-image: -moz-linear-gradient(top, #F00, #000);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #F00), color-stop(1,#000));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#F00', endColorstr='#000', GradientType='0');
}
</style>
<div id="round"></div>
演示效果图

下一篇:html页面高度不固定在不同浏览器下的兼容性设置