|
楼主 |
发表于 2011-1-7 09:20:35
|
显示全部楼层
来自 中国–陕西–咸阳
For Firefox 3.6+
background: -moz-linear-gradient(top, #ccc, #000);
For Internet Explorer
The following filter wlil only be read by IE:
filter: progidXImageTransform.Microsoft.gradient(startColorstr='#cccccc',endColorstr='#000000');
Cross-Browser CSS Gradient( demo )
Put the three lines of code from above together and the result is a cross-browser gradient box. Note: I added a background rule at the very top in case the user is using a browser that doesn’t support the feature.
background: # 999 ; /* for non-css3 browsers */ filter: progidXImageTransform.Microsoft.gradient(startColorstr= '#cccccc' , endColorstr= '#000000' ); /* for IE*/ background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(# 000 )); /*for webkit browsers */ background: -moz-linear-gradient(top, #ccc, # 000 ); /* for firefox 3.6+ */
gradient box
CSS Gradient Dropdown Menu
Below is a pure CSS gradient dropdown menu using CSS3 text-shadow, radius-border, and box-shadow (no Javascript or image)
css gradient dropdown
Internet Explorer Limitati**
Internet Explorer gradient filter doesn’t support color-stop, gradient angle, and radial gradient. That means you can only specify either horizontal or vertical linear gradient with 2 colors: StartColorStr and EndColorStr.
Final Remarks
Please note not all browsers support CSS gradient. To be safe,you shouldn’t rely on CSS gradient when coding the layout. It should only be used for enhancing the layout.
PS: in IE: filter: progidXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=’#cccccc’, endColorstr=’#000000′); for horizontal, and replace the 1 witha 0 for vertical.
not support Opera |
|