css渐变实现

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渐变实现的更多相关文章
- Gradify - 提取图片颜色,创建响应式的 CSS渐变
被请求的HTTP对象之间的延迟会有一个时间段,这个期间网页看起来不完整.Gradify 可以分析出图像中4个最常见的颜色,创建一个梯度(或纯色)作为图片占位符.Gradify 可以在在任何图像发现最突 ...
- 背景新增属性和css渐变及倒影
背景新增属性和css渐变及倒影 一.background新增属性 background-size:指定对象的背景图像的尺寸大小. background:url() 0 0,url() 0 100%;多 ...
- CSS 图像高级 CSS 渐变
CSS 渐变 CSS 渐变是在 CSS3 Image Module 中新增加的 <image> 类型. 使用 CSS 渐变可以在两种颜色间制造出平滑的渐变效果.用渐变代替图片,可以加快页面 ...
- 使用CSS渐变
转载自:https://developer.mozilla.org/zh-CN/docs/Web/Guide/CSS/Using_CSS_gradients CSS 渐变 是在 CSS3 Image ...
- CSS渐变之CSS3 gradient在Firefox3.6下的使用
一.引子 Firefox3.6包含了许多CSS的改进,本文将向您展示如果使用CSS渐变. 如果你正在运行的Firefox 3.6的最新测试版,你应该看看我们的互动演示,并查看相应的代码.使用单选按钮来 ...
- CSS技巧(1)· CSS渐变 linear-gradient
前言: 不论在网页设计中,还是传统的媒介中,各种尺寸,颜色,角度的图案在视觉中无处不在,要想在网页中实现复杂的图案,其过程往往不够理想,过去,我们可以创建一个单独的位图文件,然后每次需要做调整的时候, ...
- CSS渐变的两种基本用法
1.线性渐变(linear-gradient) 基础用法:background:linear-gradient(angle,start-color,soft-line,end-color); 依次解释 ...
- css渐变/背景
1.线性渐变(gradient变化) linear-gradient线性渐变指沿着某条直线朝一个方向产生渐变效果. 上图是从黄色渐变到绿色 background:linear-gradient( to ...
- CSS渐变字体、镂空字体、input框提示信息颜色、给图片加上内阴影、3/4圆
1.渐变字体 主要是看:-webkit-background-clip: text; 该属性 <style> .b1{ width: 500px; height: 200px; font- ...
- 好看的css渐变颜色大全网址
60个渐变颜色 https://webkul.github.io/coolhue/ 60个非常有用的CSS代码片段 https://baijiahao.baidu.com/s?id=160278735 ...
随机推荐
- 【剑指Offer面试编程题】题目1515:打印1到最大的N位数--九度OJ
题目描述: 给定一个数字N,打印从1到最大的N位数. 输入: 每个输入文件仅包含一组测试样例. 对于每个测试案例,输入一个数字N(1<=N<=5). 输出: 对应每个测试案例,依次打印从1 ...
- java异常处理动手动脑问题解决和课后总结
动手动脑 一.问题:请阅读并运行AboutException.java示例,然后通过后面的几页PPT了解Java中实现异常处理的基础知识. 1.源代码 import javax.swing.*; cl ...
- body滚动时左侧菜单固定
var top = $(".nav-frame").offset().top $(document).scroll(function(){ if($(this).scrollTop ...
- 多实例mysql的安装和管理
多实例mysql的安装和管理 http://blog.chinaunix.net/uid-20639775-id-3438560.html mysql的多实例有两种方式可以实现,两种方式各有利弊.第一 ...
- pytho 基本数据类型
1.字符串(引号) name = "........." 双引号引出来的都是字符串 name = """.........""& ...
- git客户端出现libpng warning: iCCP: known incorrect sRGB profile
在关闭gitk窗口的时候,会出现一系列的 libpng warning: iCCP: known incorrect sRGB profilelibpng warning: iCCP: known ...
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 按钮:分割按钮
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- QQ企业通---DllImport
1.DllImport 是什么? DllImport是System.Runtime.InteropServices命名空间下的一个属性类,其功能是提供从非托管DLL(托管/非托管是微软的.net fr ...
- python 中常见的异常类型汇总
异常名称 描述 BaseException 所有异常的基类 SystemExit 解释器请求退出 KeyboardInterrupt 用户中断执行(通常是输入^C) Exception 常规错误的基类 ...
- Typora: Markdown Reference (Typora下Markdown语法使用说明)
引言 由于一直在使用Typora,这个是我使用过的最棒的Markdown编辑器,但是总是忽略某一个功能,于是决定认真看一下其帮助文档 这里做一个简单主要功能的中文翻译(按键对应Windows下). 标 ...