css教程实现div背景色渐变色代码分享

建站知识 2021-07-03 08:15www.168986.cn长沙网站建设

效果图


复制代码
代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
<html xmlns="<a href="http://.w3./1999/xhtml">http://.w3./1999/xhtml</a>">
<head>
<title>CSS使背景颜色渐变--柯乐义</title>
<style type="text/css">
.jb_keleyi_{
height: 300px;
width:100px;
margin:0px auto;
background-image: -moz-linear-gradient(, #00FF00, #FF0000); /火狐/
background: -o-linear-gradient(, #00FF00 0%,red 100%);/Opera/
background-image: -webkit-gradient(linear, left , left bottom, color-s(0, #00FF00), color-s(1,#FF0000)); /Chrome/
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00FF00', endColorstr='#FF0000', GradientType='0'); /IE/
}
</style></p> <p></head>
<body>
用CSS是div颜色渐变
</p> <p><div class="jb_keleyi_">从绿到红
keleyi.</div>
</body>
</html>

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by