Created
December 6, 2012 03:57
-
-
Save shenmao1989/4221662 to your computer and use it in GitHub Desktop.
兼容性的渐变背景效果
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gradient{ | |
width:300px; | |
height:150px; | |
filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0); | |
-ms-filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);/*IE8*/ | |
background:red; /* 一些不支持背景渐变的浏览器 */ | |
background:-moz-linear-gradient(top, red, rgba(0, 0, 255, 0.5)); | |
background:-webkit-gradient(linear, 0 0, 0 bottom, from(#ff0000), to(rgba(0, 0, 255, 0.5))); | |
background:-o-linear-gradient(top, red, rgba(0, 0, 255, 0.5)); | |
} | |
<div class="gradient"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment