- <!DOCTYPE html>
- <html>
- <head>
- <style type="text/CSS">
- .gradient
- {
- background-color: #444444;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999));
- background-image: -webkit-linear-gradient(top, #444444, #999999);
- background-image: -moz-linear-gradient(top, #444444, #999999);
- background-image: -ms-linear-gradient(top, #444444, #999999);
- background-image: -o-linear-gradient(top, #444444, #999999);
- background-image: linear-gradient(top, #444444, #999999);
- filter: progid:DXImageTransform.Microsoft.gradient (startColorStr='#444444', EndColorStr='#999999');
- }
- </style>
- </head>
- <body>
- <div class="gradient" style="height: 200px; color: red">
- 这是一个css线性渐变的例子。
- </div>
- shared by <a href="http://www.CodeSnippet.cn/">CodeSnippet.CN</a>
- </body>
- </html>
- //该片段来自于http://www.codesnippet.cn/detail/191120137292.html
来源: http://www.codesnippet.cn/detail/191120137292.html