使用CSS 3来实现渐变效果

2017-08-23  本文已影响9人  orangesup
最终效果图

代码如下

CSS:

#grad1 {

height: 200px;

background: -webkit-linear-gradient(red, blue); /* Safari 5.1 - 6.0 */

background: -o-linear-gradient(red, blue); /* Opera 11.1 - 12.0 */

background: -moz-linear-gradient(red, blue); /* Firefox 3.6 - 15 */

background: linear-gradient(red, blue); /* 标准的语法(必须放在最后) */

}

HTML:

<div id="grad1"></div>

<p><strong>注意<strong>Internet Explorer 9 及之前的版本不支持渐变</p>

上一篇 下一篇

猜你喜欢

热点阅读