css如何设置渐变色


当前第2页 返回上一页

css设置线性渐变实例:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title></title>

<style>

#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); /* 标准的语法(必须放在最后) */

}

</style>

</head>

<body>

<h3>线性渐变 - 从上到下</h3>

<p>从顶部开始的线性渐变。起点是红色,慢慢过渡到蓝色:</p>

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

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

</body>

</html>

效果图:

5A)][$4FI94U$3U9IZS)0BY.png

推荐学习:css视频教程

以上就是css如何设置渐变色的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

原生js如何修改css

css怎样设置p标签不换行

css如何实现自适应分隔线?方法介绍

myeclipse css 不起作用怎么办

css中变量的的用法介绍(附示例)

clear属性怎么用

声明你的第一个css变量

css三个字如何和两个字对齐

css怎么设置背景图片位置

css是干什么的

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...