div底部的褪色文字?

时间:2014-08-14 22:17:56

标签: html css

这非常有用: Fading out text at bottom of a section with transparent div, but height stays under section after overlaying div

如何扩展它以便它可以在一个可滚动的div上工作?

应用height: 100px; overflow: auto;会导致.fadeout div最终位于滚动区域的底部。

js我目前拥有的内容:http://jsfiddle.net/6k3vV/165/

1 个答案:

答案 0 :(得分:1)

http://jsfiddle.net/6k3vV/167/

这里。需要父母也有亲戚

.fadeout {
    bottom: 0;
    height: 4em;
    background: linear-gradient(
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 1) 100%
    );
    position: absolute;
    width: 100%;
} 
section {
    height: 100px;
    overflow: auto;
}