body{
width: 100%;
height: 100%;
overflow: hidden;
}
*{
margin: 0px;
padding: 0px;
font-size: 0px;
}
.example{
width: 100%;
height: 100%;
background: -moz-linear-gradient( top,#ccc,#000);
background: -webkit-linear-gradient( top,#ccc,#cddc39);
background: -o-linear-gradient(top,#ccc, #000);
}
#grad{
width: 150%;
height: 150%;
position: absolute;
top: 0px;
left: 0px;;
background: -webkit-radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Safari 5.1 - 6.0 */
background: -o-radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Opera 11.6 - 12.0 */
background: -moz-radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Firefox 3.6 - 15 */
background: radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* 标准的语法 */
}
#grad2{
width: 170%;
height: 150%;
position: absolute;
top: -50%;
left: 20%;
background: -webkit-radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Safari 5.1 - 6.0 */
background: -o-radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Opera 11.6 - 12.0 */
background: -moz-radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Firefox 3.6 - 15 */
background: radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* 标准的语法 */
} #grad3{
width: 170%;
height: 170%;
position: absolute;
top: -50%;
left: -70%;
background: -webkit-radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Safari 5.1 - 6.0 */
background: -o-radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Opera 11.6 - 12.0 */
background: -moz-radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Firefox 3.6 - 15 */
background: radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* 标准的语法 */
}

  

线性渐变 (top)

.example {
width: 150px;
height: 80px;
background: -moz-linear-gradient( top,#ccc,#000); /*Mozilla*/
background: -webkit-linear-gradient(top,#ccc,#000); /*new gradient for Webkit*/
background: -o-linear-gradient(top,#ccc, #000); /*Opera11*/
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
}

线性渐变 (left)

.example {
width: 150px;
height: 80px;
background: -moz-linear-gradient( left,#ccc,#000); /*Mozilla*/
background: -webkit-linear-gradient(left,#ccc,#000); /*new gradient for Webkit*/
background: -o-linear-gradient(left,#ccc, #000); /*Opera11*/
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
}

线性渐变(100deg)

.example {
width: 150px;
height: 80px;
background: -moz-linear-gradient( 100deg,#ccc,#000); /*Mozilla*/
background: -webkit-linear-gradient(100deg,#ccc,#000); /*new gradient for Webkit*/
background: -o-linear-gradient(100deg,#ccc, #000); /*Opera11*/
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
}

  

线性渐变(left top)

 .example {
width: 150px;
height: 80px;
background: -moz-linear-gradient( left top,#ccc,#000); /*Mozilla*/
background: -webkit-linear-gradient(left top,#ccc,#000); /*new gradient for Webkit*/
background: -o-linear-gradient(left top,#ccc, #000); /*Opera11*/
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
}

css渐变实现的更多相关文章

  1. Gradify - 提取图片颜色,创建响应式的 CSS渐变

    被请求的HTTP对象之间的延迟会有一个时间段,这个期间网页看起来不完整.Gradify 可以分析出图像中4个最常见的颜色,创建一个梯度(或纯色)作为图片占位符.Gradify 可以在在任何图像发现最突 ...

  2. 背景新增属性和css渐变及倒影

    背景新增属性和css渐变及倒影 一.background新增属性 background-size:指定对象的背景图像的尺寸大小. background:url() 0 0,url() 0 100%;多 ...

  3. CSS 图像高级 CSS 渐变

    CSS 渐变 CSS 渐变是在 CSS3 Image Module 中新增加的 <image> 类型. 使用 CSS 渐变可以在两种颜色间制造出平滑的渐变效果.用渐变代替图片,可以加快页面 ...

  4. 使用CSS渐变

    转载自:https://developer.mozilla.org/zh-CN/docs/Web/Guide/CSS/Using_CSS_gradients CSS 渐变 是在 CSS3 Image ...

  5. CSS渐变之CSS3 gradient在Firefox3.6下的使用

    一.引子 Firefox3.6包含了许多CSS的改进,本文将向您展示如果使用CSS渐变. 如果你正在运行的Firefox 3.6的最新测试版,你应该看看我们的互动演示,并查看相应的代码.使用单选按钮来 ...

  6. CSS技巧(1)· CSS渐变 linear-gradient

    前言: 不论在网页设计中,还是传统的媒介中,各种尺寸,颜色,角度的图案在视觉中无处不在,要想在网页中实现复杂的图案,其过程往往不够理想,过去,我们可以创建一个单独的位图文件,然后每次需要做调整的时候, ...

  7. CSS渐变的两种基本用法

    1.线性渐变(linear-gradient) 基础用法:background:linear-gradient(angle,start-color,soft-line,end-color); 依次解释 ...

  8. css渐变/背景

    1.线性渐变(gradient变化) linear-gradient线性渐变指沿着某条直线朝一个方向产生渐变效果. 上图是从黄色渐变到绿色 background:linear-gradient( to ...

  9. CSS渐变字体、镂空字体、input框提示信息颜色、给图片加上内阴影、3/4圆

    1.渐变字体 主要是看:-webkit-background-clip: text; 该属性 <style> .b1{ width: 500px; height: 200px; font- ...

  10. 好看的css渐变颜色大全网址

    60个渐变颜色 https://webkul.github.io/coolhue/ 60个非常有用的CSS代码片段 https://baijiahao.baidu.com/s?id=160278735 ...

随机推荐

  1. thinkphp5.1 源码阅读

    传送地址:https://github.com/cshaptx4869/tp5.1-code-read 包含: 自动加载 容器 配置文件 钩子 门面

  2. 入门学习C链接

    参考链接:http://c.biancheng.net/view/465.html 在里面链接下载了:code:block,还有C语言入门的PDF文件. 常看网站:https://www.cnblog ...

  3. P1002 A+B for Polynomials (25分)

    1002 A+B for Polynomials (25分)   This time, you are supposed to find A+B where A and B are two polyn ...

  4. Keras入门——(3)生成式对抗网络GAN

    导入 matplotlib 模块: import matplotlib 查看自己版本所支持的backends: print(matplotlib.rcsetup.all_backends) 返回信息: ...

  5. day14-Python运维开发基础(内置函数、pickle序列化模块、math数学模块)

    1. 内置函数 # ### 内置函数 # abs 绝对值函数 res = abs(-10) print(res) # round 四舍五入 (n.5 n为偶数则舍去 n.5 n为奇数,则进一!) 奇进 ...

  6. 十七、java内存模型_JVM_JDK_类加载

    1.Java内存模型 共享内存模型指的就是Java内存模型(简称JMM),JMM决定一个线程对共享变量的写入时,能对另一个线程可见.从抽象的角度来看,JMM定义了线程和主内存之间的抽象关系:线程之间的 ...

  7. Zookeeper集群搭建(单机多节点,伪集群,docker-compose集群)

    Zookeeper介绍 原理简介 ZooKeeper是一个分布式的.开源的分布式应用程序协调服务.它公开了一组简单的原语,分布式应用程序可以在此基础上实现更高级别的同步.配置维护.组和命名服务.它的设 ...

  8. 2017 北京网络赛 E Cats and Fish

    Cats and Fish 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are many homeless cats in PKU campus. They ...

  9. python-模块加密hashlib

    import hashlib# md5ybm_pwd='yuanbapqingsdfs234FF234HF@F' #m = hashlib.md5() #bytes_ybq = ybm_pwd.enc ...

  10. HDU1880 魔咒词典

    题目大意:对应的输入多行,每行两个字符串,两个字符串互相映射.接下来询问的时候,如果这个字符串出现过,输出其对应的字符串. 分析:二重哈希来判断字符串是否存在,输出其对应的字符串就行.二重哈希的入门题 ...