您可以将 a<div>
与白色到透明的渐变一起使用:
HTML
<div class="line">
<div class="fadeTop"></div>
<div class="content">
This is just a sample paragraph.
</div>
</div>
CSS
.fadeTop{
height:20px;width:100%;position:absolute;left:0; top:0;
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0)));
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
}
(我在这种特殊情况下使用了梯度生成器)
看看:JSFiddle