CSS-渐变效果

CSS-渐变效果
  <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>css3渐变的效果</title>
    <style>
        div{
            text-align: center;
            width:230px;
            height: 60px;
            -webkit-border-radius:15px;
            -moz-border-radius: 15px;
        }
        .box1{
            
            代表的是谷歌的浏览器-webkit-gradient(linear,开始位置,结束位置,from(颜色),to(颜色))
            Mozilla浏览器-moz-linear-gradient(开始位置,开始颜色,结束颜色);
            
           background: -webkit-gradient(linear,left top,left bottom,from(#000),to(#999));
           background: -moz-linear-gradient(top,red,blue);
        }
        .box2{
            
            渐变效果是在css3当中的background或者background-image
            实现更加复杂的功能
            谷歌浏览器当中:color-stop:(位置,颜色),该功能是将划分的这段区域划分成0-1,开始为0,结束为1
            火狐当中为:-moz-linear-gradient(开始位置,开始颜色,中间点颜色,百分比,结束颜色)
           
            background: -webkit-gradient(linear,left top,left bottom,
                        color-stop(0.0,red),
                        color-stop(0.3,white),
                        color-stop(0.5,black),
                        color-stop(0.8,blue),
                        color-stop(1.0,green)

            );
            background: -moz-linear-gradient(top,red,#ffffff 50%,blue);
        }
            </style>
</head>
<body>
     <div class="box1"></div>
     <div class="box2"></div>
</body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值