webkit-line-clamp-029.html (918B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: -webkit-line-clamp and scrollable items</title> 4 <link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au"> 5 <link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp"> 6 <link rel="match" href="reference/webkit-line-clamp-029-ref.html"> 7 <meta name="assert" content="-webkit-line-clamp should not count lines in descendents that are scrollable, since they establish a new BFC."> 8 <style> 9 .clamp { 10 display: -webkit-box; 11 -webkit-box-orient: vertical; 12 -webkit-line-clamp: 3; 13 font: 16px / 32px monospace; 14 white-space: pre; 15 background-color: yellow; 16 overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */ 17 } 18 .child { 19 overflow: hidden; 20 } 21 </style> 22 <div class="clamp"><div class="child">Line 1 23 Line 2 24 Line 3 25 Line 4 26 Line 5</div></div> 27 <p>Following content.</p>