I'm trying to get a nice fade-out effect at the bottom of a section of text as a 'read more' indicator.
I've been following a bit off this and other tutorials, and my code currently is as follows:
html
<section>
<p>malesuada fames ac turpis egestas...leo.</p>
<p>malesuada fames ac turpis egestas...leo.</p>
<div class="fadeout"></div>
</section>
<p>Stuff after</p>
css
.fadeout {
position: relative;
bottom: 4em;
height: 4em;
background: -webkit-linear-gradient(
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 1) 100%
);
}
jsFiddle
The problem is, even when I position the transparent div over the body of text, the 4em's of space still exists between and 'Other Stuff.'
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…