码迷,mamicode.com
首页 > Web开发 > 详细

CSS线性渐变 垂直和水平渐变linear-gradient

时间:2015-05-28 14:11:46      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:css线性渐变 垂直和水平渐变linea

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS线性渐变</title>
<style type="text/css">
.test1{
width: 200px;
height: 80px;
text-align: center;
line-height: 80px;
margin-bottom: 10px;
color: White;
font-size: 20px;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=‘#FF0000‘,endColorStr=‘#F9F900‘,gradientType=‘0‘);
background: -moz-linear-gradient(top, #FF0000, #F9F900);
background: -o-linear-gradient(top,#FF0000, #F9F900);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FF0000), to(#F9F900));
}
.test2{
width: 200px;
height: 80px;
text-align: center;
line-height: 80px;
margin-bottom: 10px;
color: White;
font-size: 20px;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=‘#FF0000‘,endColorStr=‘#F9F900‘,gradientType=‘1‘);
background: -moz-linear-gradient(left, #FF0000, #F9F900);
background: -o-linear-gradient(left,#FF0000, #F9F900);
background: -webkit-gradient(linear, 0% 0%, 100% 0%, from(#FF0000), to(#F9F900));
}
</style>
</head>
<body>
<div><A href="http://www.999jiujiu.com/">http://www.999jiujiu.com/</A></div>
<div class="test1">CSS垂直渐变</div>
<div class="test2">CSS水平渐变</div>
</body>
</html>

CSS线性渐变 垂直和水平渐变linear-gradient

标签:css线性渐变 垂直和水平渐变linea

原文地址:http://blog.csdn.net/life66881/article/details/46120739

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!