Hide long text except the first two paragraphs
Posted
by
Barbara
on Stack Overflow
See other posts from Stack Overflow
or by Barbara
Published on 2012-03-31T17:18:47Z
Indexed on
2012/03/31
17:29 UTC
Read the original article
Hit count: 218
nth-child
I have a very long text and I need to hide everything except the first two paragraphs. For various reasons I'd rather not use jquery for this site. Can this be done with css only? I know nth-child most likely will do the trick but I'm having troubles coming up with a specific rule.
<div class="text">
<p>display<p>
<p>display</p>
<p>hide from this point</p>
<p>...</p>
</div>
© Stack Overflow or respective owner