`
yxgblog
  • 浏览: 37462 次
  • 性别: Icon_minigender_2
  • 来自: 郑州
最近访客 更多访客>>
社区版块
存档分类
最新评论

css实现渐变效果

阅读更多
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
<!--
.content { width:600px; height:200px; margin:0 auto;}
.ft h1 { font-family:Tahoma, Geneva, sans-serif; font-size:330%/100%; font-weight:bold; margin:30px 0 50px;; color:#464646; position:relative;}
.ft h1 span { background:url(gradient-white.png) repeat-x; display:block; width:100%; position:absolute; height:31px;  }
-->
</style>
</head>

<body>
<div class="content"><div class="ft"><h1><span></span>gradrangc</h1></div></div>
</body>
</html>

使用背景图片遮盖,和一个空的span标签,还有position: absolute声明来实现文本的渐变效果。
  • 大小: 145 Bytes
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics