webkit-line-clamp-016.html (955B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: -webkit-line-clamp value on flex child</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-016-ref.html"> 7 <meta name="assert" content="-webkit-line-clamp value on the child of the clamping context should be ignored (since it doesn't carry -webkit-box nor webkit-box-orient:vertical itself."> 8 <style> 9 .clamp { 10 display: -webkit-box; 11 -webkit-box-orient: vertical; 12 -webkit-line-clamp: 2; 13 font: 16px / 32px serif; 14 white-space: pre; 15 padding: 0 4px; 16 background-color: yellow; 17 overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */ 18 } 19 .child { 20 -webkit-line-clamp: 3; 21 } 22 </style> 23 <div class="clamp"><div class="child">Line 1 24 Line 2 25 Line 3 26 Line 4 27 Line 5</div></div>